mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-13 21:50:33 +03:00
* use new job style for ddclient upstart
svn path=/nixos/trunk/; revision=17184
This commit is contained in:
parent
44f99c64d4
commit
bb8c6b038d
1 changed files with 22 additions and 26 deletions
|
@ -15,18 +15,18 @@ let
|
||||||
ddclientFlags = "-foreground -file ${ddclientCfg}";
|
ddclientFlags = "-foreground -file ${ddclientCfg}";
|
||||||
|
|
||||||
ddclientCfg = pkgs.writeText "ddclient.conf" ''
|
ddclientCfg = pkgs.writeText "ddclient.conf" ''
|
||||||
daemon=600
|
daemon=600
|
||||||
cache=${stateDir}/ddclient.cache
|
cache=${stateDir}/ddclient.cache
|
||||||
pid=${stateDir}/ddclient.pid
|
pid=${stateDir}/ddclient.pid
|
||||||
use=${config.services.ddclient.web}
|
use=${config.services.ddclient.web}
|
||||||
login=${config.services.ddclient.username}
|
login=${config.services.ddclient.username}
|
||||||
password=${config.services.ddclient.password}
|
password=${config.services.ddclient.password}
|
||||||
protocol=${config.services.ddclient.protocol}
|
protocol=${config.services.ddclient.protocol}
|
||||||
server=${config.services.ddclient.server}
|
server=${config.services.ddclient.server}
|
||||||
wildcard=YES
|
wildcard=YES
|
||||||
${config.services.ddclient.domain}
|
${config.services.ddclient.domain}
|
||||||
${config.services.ddclient.extraConfig}
|
${config.services.ddclient.extraConfig}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
in
|
in
|
||||||
|
|
||||||
|
@ -113,24 +113,20 @@ in
|
||||||
jobs = singleton {
|
jobs = singleton {
|
||||||
|
|
||||||
name = "ddclient";
|
name = "ddclient";
|
||||||
|
|
||||||
job = ''
|
|
||||||
description "ddclient daemon"
|
|
||||||
|
|
||||||
start on startup
|
startOn = "startup";
|
||||||
stop on shutdown
|
stopOn = "shutdown";
|
||||||
|
|
||||||
start script
|
preStart = ''
|
||||||
|
mkdir -m 0755 -p ${stateDir}
|
||||||
|
chown ${ddclientUser} ${stateDir}
|
||||||
|
|
||||||
mkdir -m 0755 -p ${stateDir}
|
# Needed to run ddclient as an unprivileged user.
|
||||||
chown ${ddclientUser} ${stateDir}
|
${modprobe}/sbin/modprobe capability || true
|
||||||
|
'';
|
||||||
|
|
||||||
# Needed to run ddclient as an unprivileged user.
|
script = ''
|
||||||
${modprobe}/sbin/modprobe capability || true
|
${ddclient}/bin/ddclient ${ddclientFlags}
|
||||||
|
|
||||||
end script
|
|
||||||
|
|
||||||
respawn ${ddclient}/bin/ddclient ${ddclientFlags}
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue