Brltty service: simplified systemd service definition, now it matches

the
variant that has been developed upstream. Now the BRLTTY service comes up reliably on boot.
This commit is contained in:
Bram Duvigneau 2015-09-09 11:51:22 +02:00
parent ee83598688
commit 18acb80b82
1 changed files with 17 additions and 11 deletions

View File

@ -5,10 +5,6 @@ with lib;
let let
cfg = config.services.brltty; cfg = config.services.brltty;
stateDir = "/run/brltty";
pidFile = "${stateDir}/brltty.pid";
in { in {
options = { options = {
@ -24,14 +20,24 @@ in {
config = mkIf cfg.enable { config = mkIf cfg.enable {
systemd.services.brltty = { systemd.services.brltty = {
description = "Braille console driver"; description = "Braille Device Support";
preStart = '' unitConfig = {
mkdir -p ${stateDir} Documentation = "http://mielke.cc/brltty/";
''; DefaultDependencies = "no";
RequiresMountsFor = "${pkgs.brltty}/var/lib/brltty";
};
serviceConfig = { serviceConfig = {
ExecStart = "${pkgs.brltty}/bin/brltty --pid-file=${pidFile}"; ExecStart = "${pkgs.brltty}/bin/brltty --no-daemon";
Type = "forking"; Type = "simple"; # Change to notidy after next releae
PIDFile = pidFile; TimeoutStartSec = 5;
TimeoutStopSec = 10;
Restart = "always";
RestartSec = 30;
Nice = -10;
OOMScoreAdjust = -900;
ProtectHome = "read-only";
ProtectSystem = "full";
SystemCallArchitectures = "native";
}; };
before = [ "sysinit.target" ]; before = [ "sysinit.target" ];
wantedBy = [ "sysinit.target" ]; wantedBy = [ "sysinit.target" ];