From bb8c6b038d05a4c2a20cd5f6e5d3ca6eb1bd5323 Mon Sep 17 00:00:00 2001 From: Rob Vermaas Date: Wed, 16 Sep 2009 11:57:41 +0000 Subject: [PATCH] * use new job style for ddclient upstart svn path=/nixos/trunk/; revision=17184 --- modules/services/networking/ddclient.nix | 48 +++++++++++------------- 1 file changed, 22 insertions(+), 26 deletions(-) diff --git a/modules/services/networking/ddclient.nix b/modules/services/networking/ddclient.nix index c22a1535b54..7d99a95131f 100644 --- a/modules/services/networking/ddclient.nix +++ b/modules/services/networking/ddclient.nix @@ -15,18 +15,18 @@ let ddclientFlags = "-foreground -file ${ddclientCfg}"; ddclientCfg = pkgs.writeText "ddclient.conf" '' -daemon=600 -cache=${stateDir}/ddclient.cache -pid=${stateDir}/ddclient.pid -use=${config.services.ddclient.web} -login=${config.services.ddclient.username} -password=${config.services.ddclient.password} -protocol=${config.services.ddclient.protocol} -server=${config.services.ddclient.server} -wildcard=YES -${config.services.ddclient.domain} -${config.services.ddclient.extraConfig} -''; + daemon=600 + cache=${stateDir}/ddclient.cache + pid=${stateDir}/ddclient.pid + use=${config.services.ddclient.web} + login=${config.services.ddclient.username} + password=${config.services.ddclient.password} + protocol=${config.services.ddclient.protocol} + server=${config.services.ddclient.server} + wildcard=YES + ${config.services.ddclient.domain} + ${config.services.ddclient.extraConfig} + ''; in @@ -113,24 +113,20 @@ in jobs = singleton { name = "ddclient"; - - job = '' - description "ddclient daemon" - start on startup - stop on shutdown + startOn = "startup"; + stopOn = "shutdown"; - start script + preStart = '' + mkdir -m 0755 -p ${stateDir} + chown ${ddclientUser} ${stateDir} - mkdir -m 0755 -p ${stateDir} - chown ${ddclientUser} ${stateDir} + # Needed to run ddclient as an unprivileged user. + ${modprobe}/sbin/modprobe capability || true + ''; - # Needed to run ddclient as an unprivileged user. - ${modprobe}/sbin/modprobe capability || true - - end script - - respawn ${ddclient}/bin/ddclient ${ddclientFlags} + script = '' + ${ddclient}/bin/ddclient ${ddclientFlags} ''; };