* Use the ‘path’ attribute in Upstart jobs in more places. It's a bit

more readable (also in "ps" output).

svn path=/nixos/trunk/; revision=30565
wip/yesman
Eelco Dolstra 13 years ago
parent 1d5d7036d0
commit 8eba736da9
  1. 6
      modules/services/hardware/acpid.nix
  2. 14
      modules/services/hardware/udev.nix
  3. 4
      modules/services/logging/klogd.nix
  4. 4
      modules/services/logging/syslogd.nix
  5. 8
      modules/services/misc/nix-daemon.nix
  6. 4
      modules/services/networking/dhclient.nix
  7. 6
      modules/services/networking/ntpd.nix
  8. 5
      modules/services/networking/wpa_supplicant.nix
  9. 4
      modules/services/networking/xinetd.nix
  10. 5
      modules/services/printing/cupsd.nix
  11. 4
      modules/services/scheduling/atd.nix
  12. 4
      modules/services/scheduling/cron.nix
  13. 6
      modules/services/system/dbus.nix
  14. 4
      modules/services/system/nscd.nix
  15. 8
      modules/services/ttys/mingetty.nix
  16. 20
      modules/services/web-servers/apache-httpd/default.nix
  17. 4
      modules/services/web-servers/apache-httpd/mercurial.nix
  18. 2
      modules/services/web-servers/apache-httpd/zabbix.nix

@ -99,7 +99,11 @@ in
startOn = "stopped udevtrigger and started syslogd";
exec = "${pkgs.acpid}/sbin/acpid --foreground --confdir ${acpiConfDir}";
path = [ pkgs.acpid ];
daemonType = "fork";
exec = "acpid --confdir ${acpiConfDir}";
};
};

@ -215,6 +215,8 @@ in
environment = { UDEV_CONFIG_FILE = conf; };
path = [ udev ];
preStart =
''
echo "" > /proc/sys/kernel/hotplug || true
@ -234,7 +236,7 @@ in
daemonType = "fork";
exec = "${udev}/sbin/udevd --daemon";
exec = "udevd --daemon";
};
jobs.udevtrigger =
@ -242,6 +244,8 @@ in
task = true;
path = [ udev ];
script =
''
# Let udev create device nodes for all modules that have already
@ -249,10 +253,10 @@ in
# the kernel). The `STARTUP' variable is needed to force
# the LVM rules to create device nodes. See
# http://www.mail-archive.com/fedora-devel-list@redhat.com/msg10261.html
${udev}/sbin/udevadm control --env=STARTUP=1
${udev}/sbin/udevadm trigger --action=add
${udev}/sbin/udevadm settle # wait for udev to finish
${udev}/sbin/udevadm control --env=STARTUP=
udevadm control --env=STARTUP=1
udevadm trigger --action=add
udevadm settle # wait for udev to finish
udevadm control --env=STARTUP=
initctl emit -n new-devices
'';

@ -9,8 +9,10 @@
startOn = "started syslogd";
path = [ pkgs.sysklogd ];
exec =
"${pkgs.sysklogd}/sbin/klogd -c 1 -2 -n " +
"klogd -c 1 -2 -n " +
"-k $(dirname $(readlink -f /var/run/booted-system/kernel))/System.map";
};

@ -102,7 +102,9 @@ in
daemonType = "fork";
exec = "${pkgs.sysklogd}/sbin/syslogd ${toString cfg.extraParams} -f ${syslogConf}";
path = [ pkgs.sysklogd ];
exec = "syslogd ${toString cfg.extraParams} -f ${syslogConf}";
};
};

@ -249,14 +249,16 @@ in
startOn = "startup";
path = [ nix pkgs.openssl pkgs.utillinux ]
++ optionals config.nix.distributedBuilds [ pkgs.openssh pkgs.gzip ];
script =
''
export PATH=${if config.nix.distributedBuilds then "${pkgs.openssh}/bin:${pkgs.gzip}/bin:" else ""}${pkgs.openssl}/bin:${nix}/bin:$PATH
${config.nix.envVars}
exec \
nice -n ${builtins.toString config.nix.daemonNiceLevel} \
${pkgs.utillinux}/bin/ionice -n ${builtins.toString config.nix.daemonIONiceLevel} \
${nix}/bin/nix-worker --daemon > /dev/null 2>&1
ionice -n ${builtins.toString config.nix.daemonIONiceLevel} \
nix-worker --daemon > /dev/null 2>&1
'';
extraConfig =

@ -67,6 +67,8 @@ in
{ startOn = "started network-interfaces";
stopOn = "stopping network-interfaces";
path = [ dhcp ];
preStart =
''
# dhclient barfs if /proc/net/if_inet6 doesn't exist.
@ -101,7 +103,7 @@ in
mkdir -m 755 -p ${stateDir}
exec ${dhcp}/sbin/dhclient -d $interfaces -e "PATH=$PATH" -lf ${stateDir}/dhclient.leases -sf ${dhcp}/sbin/dhclient-script
exec dhclient -d $interfaces -e "PATH=$PATH" -lf ${stateDir}/dhclient.leases -sf ${dhcp}/sbin/dhclient-script
'';
};

@ -75,6 +75,8 @@ in
startOn = "ip-up";
path = [ ntp ];
preStart =
''
mkdir -m 0755 -p ${stateDir}
@ -88,10 +90,10 @@ in
# because Upstart cannot kill jobs stuck in the start
# phase. Thus a hanging ntpd job can block system
# shutdown.
# ${ntp}/bin/ntpd -q -g ${ntpFlags}
# ntpd -q -g ${ntpFlags}
'';
exec = "${ntp}/bin/ntpd -g -n ${ntpFlags}";
exec = "ntpd -g -n ${ntpFlags}";
};
};

@ -48,6 +48,8 @@ in
{ startOn = "started network-interfaces";
stopOn = "stopping network-interfaces";
path = [ pkgs.wpa_supplicant ];
preStart =
''
touch -a ${configFile}
@ -55,8 +57,7 @@ in
'';
exec =
"${pkgs.wpa_supplicant}/sbin/wpa_supplicant " +
"-s -C /var/run/wpa_supplicant " +
"wpa_supplicant -s -C /var/run/wpa_supplicant " +
"-c ${configFile} -i${config.networking.WLANInterface}";
};

@ -132,7 +132,9 @@ in
startOn = "started network-interfaces";
stopOn = "stopping network-interfaces";
exec = "${xinetd}/sbin/xinetd -syslog daemon -dontfork -stayalive -f ${configFile}";
path = [ xinetd ];
exec = "xinetd -syslog daemon -dontfork -stayalive -f ${configFile}";
};
};

@ -129,7 +129,8 @@ in
startOn = "started network-interfaces";
stopOn = "stopping network-interfaces";
path = [ config.system.path ];
# !!! Why is config.system.path in here?
path = [ cups config.system.path ];
preStart =
''
@ -140,7 +141,7 @@ in
mkdir -m 0755 -p ${cfg.tempDir}
'';
exec = "${cups}/sbin/cupsd -c ${pkgs.writeText "cupsd.conf" cfg.cupsdConf} -F";
exec = "cupsd -c ${pkgs.writeText "cupsd.conf" cfg.cupsdConf} -F";
};
services.printing.drivers = [ pkgs.cups pkgs.cups_pdf_filter pkgs.ghostscript additionalBackends ];

@ -68,6 +68,8 @@ in
startOn = "stopped udevtrigger";
path = [ at ];
preStart =
''
# Snippets taken and adapted from the original `install' rule of
@ -99,7 +101,7 @@ in
fi
'';
exec = "${at}/sbin/atd";
exec = "atd";
daemonType = "fork";
};

@ -93,6 +93,8 @@ in
# Needed to interpret times in the local timezone.
environment = { TZ = config.time.timeZone; };
path = [ cronNixosPkg ];
preStart =
''
mkdir -m 710 -p /var/cron
@ -104,7 +106,7 @@ in
fi
'';
exec = "${cronNixosPkg}/sbin/cron -n";
exec = "cron -n";
};
};

@ -118,20 +118,22 @@ in
jobs.dbus =
{ startOn = "started udev and started syslogd";
path = [ pkgs.dbus_daemon pkgs.dbus_tools ];
preStart =
''
mkdir -m 0755 -p ${homeDir}
chown messagebus ${homeDir}
mkdir -m 0755 -p /var/lib/dbus
${pkgs.dbus_tools}/bin/dbus-uuidgen --ensure
dbus-uuidgen --ensure
rm -f ${homeDir}/pid
'';
daemonType = "fork";
exec = "${pkgs.dbus_daemon}/bin/dbus-daemon --system";
exec = "dbus-daemon --system";
postStop =
''

@ -52,7 +52,9 @@ in
mkdir -m 0755 -p /var/db/nscd
'';
exec = "${pkgs.glibc}/sbin/nscd -f ${./nscd.conf} -d 2> /dev/null";
path = [ pkgs.glibc ];
exec = "nscd -f ${./nscd.conf} -d 2> /dev/null";
};
};

@ -60,11 +60,11 @@ with pkgs.lib;
startOn = "started udev and filesystem";
exec = "${pkgs.mingetty}/sbin/mingetty --loginprog=${pkgs.shadow}/bin/login --noclear ${tty}";
path = [ pkgs.mingetty ];
environment = {
LOCALE_ARCHIVE = "/var/run/current-system/sw/lib/locale/locale-archive";
};
exec = "mingetty --loginprog=${pkgs.shadow}/bin/login --noclear ${tty}";
environment.LOCALE_ARCHIVE = "/var/run/current-system/sw/lib/locale/locale-archive";
}) config.services.mingetty.ttys);

@ -562,16 +562,16 @@ in
# the latter is enabled.
+ optionalString config.services.postgresql.enable " and started postgresql";
environment =
{ PATH = concatStringsSep ":" (
[ "${pkgs.coreutils}/bin" "${pkgs.gnugrep}/bin" ]
++ # Needed for PHP's mail() function. !!! Probably the
# ssmtp module should export the path to sendmail in
# some way.
optional config.networking.defaultMailServer.directDelivery "${pkgs.ssmtp}/sbin"
++ (concatMap (svc: svc.extraServerPath) allSubservices) );
path =
[ httpd pkgs.coreutils pkgs.gnugrep ]
++ # Needed for PHP's mail() function. !!! Probably the
# ssmtp module should export the path to sendmail in
# some way.
optional config.networking.defaultMailServer.directDelivery pkgs.ssmtp
++ concatMap (svc: svc.extraServerPath) allSubservices;
PHPRC = if enablePHP then phpIni else "";
environment =
{ PHPRC = if enablePHP then phpIni else "";
TZ = config.time.timeZone;
@ -605,7 +605,7 @@ in
daemonType = "fork";
exec = "${httpd}/bin/httpd -f ${httpdConf}";
exec = "httpd -f ${httpdConf}";
preStop =
''

@ -51,9 +51,7 @@ in {
Disallow: ${urlPrefix}
'';
extraServerPath = [
(pkgs.python+"/bin")
];
extraServerPath = [ pkgs.python ];
globalEnvVars = [ { name = "PYTHONPATH"; value = "${mercurial}/lib/${pkgs.python.libPrefix}/site-packages"; } ];

@ -46,7 +46,7 @@ in
'';
# The frontend needs "ps" to find out whether zabbix_server is running.
extraServerPath = ["${pkgs.procps}/bin"];
extraServerPath = [ pkgs.procps ];
options = {

Loading…
Cancel
Save