Author: eelco Date: Fri Nov 25 16:32:54 2011 New Revision: 30565 URL: https://nixos.org/websvn/nix/?rev=30565&sc=1
Log: * Use the ‘path’ attribute in Upstart jobs in more places. It's a bit more readable (also in "ps" output). Modified: nixos/trunk/modules/services/hardware/acpid.nix nixos/trunk/modules/services/hardware/udev.nix nixos/trunk/modules/services/logging/klogd.nix nixos/trunk/modules/services/logging/syslogd.nix nixos/trunk/modules/services/misc/nix-daemon.nix nixos/trunk/modules/services/networking/dhclient.nix nixos/trunk/modules/services/networking/ntpd.nix nixos/trunk/modules/services/networking/wpa_supplicant.nix nixos/trunk/modules/services/networking/xinetd.nix nixos/trunk/modules/services/printing/cupsd.nix nixos/trunk/modules/services/scheduling/atd.nix nixos/trunk/modules/services/scheduling/cron.nix nixos/trunk/modules/services/system/dbus.nix nixos/trunk/modules/services/system/nscd.nix nixos/trunk/modules/services/ttys/mingetty.nix nixos/trunk/modules/services/web-servers/apache-httpd/default.nix nixos/trunk/modules/services/web-servers/apache-httpd/mercurial.nix nixos/trunk/modules/services/web-servers/apache-httpd/zabbix.nix Modified: nixos/trunk/modules/services/hardware/acpid.nix ============================================================================== --- nixos/trunk/modules/services/hardware/acpid.nix Fri Nov 25 13:44:52 2011 (r30564) +++ nixos/trunk/modules/services/hardware/acpid.nix Fri Nov 25 16:32:54 2011 (r30565) @@ -99,7 +99,11 @@ startOn = "stopped udevtrigger and started syslogd"; - exec = "${pkgs.acpid}/sbin/acpid --foreground --confdir ${acpiConfDir}"; + path = [ pkgs.acpid ]; + + daemonType = "fork"; + + exec = "acpid --confdir ${acpiConfDir}"; }; }; Modified: nixos/trunk/modules/services/hardware/udev.nix ============================================================================== --- nixos/trunk/modules/services/hardware/udev.nix Fri Nov 25 13:44:52 2011 (r30564) +++ nixos/trunk/modules/services/hardware/udev.nix Fri Nov 25 16:32:54 2011 (r30565) @@ -215,6 +215,8 @@ environment = { UDEV_CONFIG_FILE = conf; }; + path = [ udev ]; + preStart = '' echo "" > /proc/sys/kernel/hotplug || true @@ -234,7 +236,7 @@ daemonType = "fork"; - exec = "${udev}/sbin/udevd --daemon"; + exec = "udevd --daemon"; }; jobs.udevtrigger = @@ -242,6 +244,8 @@ task = true; + path = [ udev ]; + script = '' # Let udev create device nodes for all modules that have already @@ -249,10 +253,10 @@ # 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 ''; Modified: nixos/trunk/modules/services/logging/klogd.nix ============================================================================== --- nixos/trunk/modules/services/logging/klogd.nix Fri Nov 25 13:44:52 2011 (r30564) +++ nixos/trunk/modules/services/logging/klogd.nix Fri Nov 25 16:32:54 2011 (r30565) @@ -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"; }; Modified: nixos/trunk/modules/services/logging/syslogd.nix ============================================================================== --- nixos/trunk/modules/services/logging/syslogd.nix Fri Nov 25 13:44:52 2011 (r30564) +++ nixos/trunk/modules/services/logging/syslogd.nix Fri Nov 25 16:32:54 2011 (r30565) @@ -102,7 +102,9 @@ daemonType = "fork"; - exec = "${pkgs.sysklogd}/sbin/syslogd ${toString cfg.extraParams} -f ${syslogConf}"; + path = [ pkgs.sysklogd ]; + + exec = "syslogd ${toString cfg.extraParams} -f ${syslogConf}"; }; }; Modified: nixos/trunk/modules/services/misc/nix-daemon.nix ============================================================================== --- nixos/trunk/modules/services/misc/nix-daemon.nix Fri Nov 25 13:44:52 2011 (r30564) +++ nixos/trunk/modules/services/misc/nix-daemon.nix Fri Nov 25 16:32:54 2011 (r30565) @@ -249,14 +249,16 @@ 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 = Modified: nixos/trunk/modules/services/networking/dhclient.nix ============================================================================== --- nixos/trunk/modules/services/networking/dhclient.nix Fri Nov 25 13:44:52 2011 (r30564) +++ nixos/trunk/modules/services/networking/dhclient.nix Fri Nov 25 16:32:54 2011 (r30565) @@ -67,6 +67,8 @@ { 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 @@ 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 ''; }; Modified: nixos/trunk/modules/services/networking/ntpd.nix ============================================================================== --- nixos/trunk/modules/services/networking/ntpd.nix Fri Nov 25 13:44:52 2011 (r30564) +++ nixos/trunk/modules/services/networking/ntpd.nix Fri Nov 25 16:32:54 2011 (r30565) @@ -75,6 +75,8 @@ startOn = "ip-up"; + path = [ ntp ]; + preStart = '' mkdir -m 0755 -p ${stateDir} @@ -88,10 +90,10 @@ # 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}"; }; }; Modified: nixos/trunk/modules/services/networking/wpa_supplicant.nix ============================================================================== --- nixos/trunk/modules/services/networking/wpa_supplicant.nix Fri Nov 25 13:44:52 2011 (r30564) +++ nixos/trunk/modules/services/networking/wpa_supplicant.nix Fri Nov 25 16:32:54 2011 (r30565) @@ -48,6 +48,8 @@ { startOn = "started network-interfaces"; stopOn = "stopping network-interfaces"; + path = [ pkgs.wpa_supplicant ]; + preStart = '' touch -a ${configFile} @@ -55,8 +57,7 @@ ''; 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}"; }; Modified: nixos/trunk/modules/services/networking/xinetd.nix ============================================================================== --- nixos/trunk/modules/services/networking/xinetd.nix Fri Nov 25 13:44:52 2011 (r30564) +++ nixos/trunk/modules/services/networking/xinetd.nix Fri Nov 25 16:32:54 2011 (r30565) @@ -132,7 +132,9 @@ 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}"; }; }; Modified: nixos/trunk/modules/services/printing/cupsd.nix ============================================================================== --- nixos/trunk/modules/services/printing/cupsd.nix Fri Nov 25 13:44:52 2011 (r30564) +++ nixos/trunk/modules/services/printing/cupsd.nix Fri Nov 25 16:32:54 2011 (r30565) @@ -129,7 +129,8 @@ 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 @@ 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 ]; Modified: nixos/trunk/modules/services/scheduling/atd.nix ============================================================================== --- nixos/trunk/modules/services/scheduling/atd.nix Fri Nov 25 13:44:52 2011 (r30564) +++ nixos/trunk/modules/services/scheduling/atd.nix Fri Nov 25 16:32:54 2011 (r30565) @@ -68,6 +68,8 @@ startOn = "stopped udevtrigger"; + path = [ at ]; + preStart = '' # Snippets taken and adapted from the original `install' rule of @@ -99,7 +101,7 @@ fi ''; - exec = "${at}/sbin/atd"; + exec = "atd"; daemonType = "fork"; }; Modified: nixos/trunk/modules/services/scheduling/cron.nix ============================================================================== --- nixos/trunk/modules/services/scheduling/cron.nix Fri Nov 25 13:44:52 2011 (r30564) +++ nixos/trunk/modules/services/scheduling/cron.nix Fri Nov 25 16:32:54 2011 (r30565) @@ -93,6 +93,8 @@ # 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 @@ fi ''; - exec = "${cronNixosPkg}/sbin/cron -n"; + exec = "cron -n"; }; }; Modified: nixos/trunk/modules/services/system/dbus.nix ============================================================================== --- nixos/trunk/modules/services/system/dbus.nix Fri Nov 25 13:44:52 2011 (r30564) +++ nixos/trunk/modules/services/system/dbus.nix Fri Nov 25 16:32:54 2011 (r30565) @@ -118,20 +118,22 @@ 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 = '' Modified: nixos/trunk/modules/services/system/nscd.nix ============================================================================== --- nixos/trunk/modules/services/system/nscd.nix Fri Nov 25 13:44:52 2011 (r30564) +++ nixos/trunk/modules/services/system/nscd.nix Fri Nov 25 16:32:54 2011 (r30565) @@ -52,7 +52,9 @@ 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"; }; }; Modified: nixos/trunk/modules/services/ttys/mingetty.nix ============================================================================== --- nixos/trunk/modules/services/ttys/mingetty.nix Fri Nov 25 13:44:52 2011 (r30564) +++ nixos/trunk/modules/services/ttys/mingetty.nix Fri Nov 25 16:32:54 2011 (r30565) @@ -60,11 +60,11 @@ 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); Modified: nixos/trunk/modules/services/web-servers/apache-httpd/default.nix ============================================================================== --- nixos/trunk/modules/services/web-servers/apache-httpd/default.nix Fri Nov 25 13:44:52 2011 (r30564) +++ nixos/trunk/modules/services/web-servers/apache-httpd/default.nix Fri Nov 25 16:32:54 2011 (r30565) @@ -562,16 +562,16 @@ # 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 @@ daemonType = "fork"; - exec = "${httpd}/bin/httpd -f ${httpdConf}"; + exec = "httpd -f ${httpdConf}"; preStop = '' Modified: nixos/trunk/modules/services/web-servers/apache-httpd/mercurial.nix ============================================================================== --- nixos/trunk/modules/services/web-servers/apache-httpd/mercurial.nix Fri Nov 25 13:44:52 2011 (r30564) +++ nixos/trunk/modules/services/web-servers/apache-httpd/mercurial.nix Fri Nov 25 16:32:54 2011 (r30565) @@ -51,9 +51,7 @@ Disallow: ${urlPrefix} ''; - extraServerPath = [ - (pkgs.python+"/bin") - ]; + extraServerPath = [ pkgs.python ]; globalEnvVars = [ { name = "PYTHONPATH"; value = "${mercurial}/lib/${pkgs.python.libPrefix}/site-packages"; } ]; Modified: nixos/trunk/modules/services/web-servers/apache-httpd/zabbix.nix ============================================================================== --- nixos/trunk/modules/services/web-servers/apache-httpd/zabbix.nix Fri Nov 25 13:44:52 2011 (r30564) +++ nixos/trunk/modules/services/web-servers/apache-httpd/zabbix.nix Fri Nov 25 16:32:54 2011 (r30565) @@ -46,7 +46,7 @@ ''; # The frontend needs "ps" to find out whether zabbix_server is running. - extraServerPath = ["${pkgs.procps}/bin"]; + extraServerPath = [ pkgs.procps ]; options = { _______________________________________________ nix-commits mailing list nix-comm...@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-commits