* Change all the startOn / stopOn attributes to the Upstart 0.6 syntax

(e.g., startOn = "started foo" instead of startOn = "foo").

svn path=/nixos/branches/upstart-0.6/; revision=18230
This commit is contained in:
Eelco Dolstra 2009-11-06 22:19:17 +00:00
parent 6b0842ff52
commit 83a9bf9a6a
50 changed files with 77 additions and 98 deletions

View File

@ -46,7 +46,7 @@ in
}; };
jobs.alsa = jobs.alsa =
{ startOn = "udev"; { startOn = "started udev";
preStart = preStart =
'' ''

View File

@ -66,7 +66,6 @@ in
{ description = "PulseAudio system-wide server"; { description = "PulseAudio system-wide server";
startOn = "startup"; startOn = "startup";
stopOn = "shutdown";
preStart = preStart =
'' ''

View File

@ -75,8 +75,7 @@ in
jobs.mysql = jobs.mysql =
{ description = "MySQL server"; { description = "MySQL server";
startOn = "filesystems"; startOn = "started filesystems";
stopOn = "shutdown";
preStart = preStart =
'' ''

View File

@ -116,8 +116,7 @@ in
jobs.postgresql = jobs.postgresql =
{ description = "PostgreSQL server"; { description = "PostgreSQL server";
startOn = "${startDependency}/started"; startOn = "started ${startDependency}";
stopOn = "shutdown";
preStart = preStart =
'' ''

View File

@ -79,8 +79,7 @@ in
jobs.acpid = jobs.acpid =
{ description = "ACPI daemon"; { description = "ACPI daemon";
startOn = "udev"; startOn = "started udev";
stopOn = "shutdown";
exec = "${pkgs.acpid}/sbin/acpid --foreground --confdir ${acpiConfDir}"; exec = "${pkgs.acpid}/sbin/acpid --foreground --confdir ${acpiConfDir}";
}; };

View File

@ -70,7 +70,6 @@ in
# !!! TODO: make sure that HAL starts after acpid, # !!! TODO: make sure that HAL starts after acpid,
# otherwise hald-addon-acpi will grab /proc/acpi/event. # otherwise hald-addon-acpi will grab /proc/acpi/event.
startOn = if config.powerManagement.enable then "started acpid" else "started dbus"; startOn = if config.powerManagement.enable then "started acpid" else "started dbus";
stopOn = "shutdown";
environment = environment =
{ # !!! HACK? These environment variables manipulated inside { # !!! HACK? These environment variables manipulated inside

View File

@ -159,7 +159,6 @@ in
jobs.udev = jobs.udev =
{ startOn = "startup"; { startOn = "startup";
stopOn = "shutdown";
environment = { UDEV_CONFIG_FILE = conf; }; environment = { UDEV_CONFIG_FILE = conf; };

View File

@ -8,7 +8,6 @@
{ description = "Kernel log daemon"; { description = "Kernel log daemon";
startOn = "started syslogd"; startOn = "started syslogd";
stopOn = "shutdown";
exec = exec =
"${pkgs.sysklogd}/sbin/klogd -c 1 -2 -n " + "${pkgs.sysklogd}/sbin/klogd -c 1 -2 -n " +

View File

@ -116,7 +116,7 @@ in
jobs.dovecot = jobs.dovecot =
{ description = "Dovecot IMAP/POP3 server"; { description = "Dovecot IMAP/POP3 server";
startOn = "${startingDependency}/started"; startOn = "started ${startingDependency}";
preStart = preStart =
'' ''

View File

@ -283,7 +283,7 @@ in
# accurate way is unlikely to be better. # accurate way is unlikely to be better.
{ description = "Postfix mail server"; { description = "Postfix mail server";
startOn = "${startingDependency}/started"; startOn = "started ${startingDependency}";
script = script =
'' ''

View File

@ -75,8 +75,8 @@ in
jobs.autofs = jobs.autofs =
{ description = "Filesystem automounter"; { description = "Filesystem automounter";
startOn = "network-interfaces/started"; startOn = "started network-interfaces";
stopOn = "network-interfaces/stop"; stopOn = "stopping network-interfaces";
environment = environment =
{ PATH = "${pkgs.nfsUtils}/sbin:${config.system.sbin.modprobe}/sbin"; { PATH = "${pkgs.nfsUtils}/sbin:${config.system.sbin.modprobe}/sbin";

View File

@ -39,8 +39,7 @@ in
jobs.disnix = jobs.disnix =
{ description = "Disnix server"; { description = "Disnix server";
startOn = "dbus"; startOn = "started dbus";
stopOn = "shutdown";
script = script =
'' ''

View File

@ -88,8 +88,8 @@ in
jobs.gpsd = jobs.gpsd =
{ description = "GPSD daemon"; { description = "GPSD daemon";
startOn = "network-interfaces/started"; startOn = "started network-interfaces";
stopOn = "network-interfaces/stop"; stopOn = "stopping network-interfaces";
exec = exec =
'' ''

View File

@ -78,8 +78,7 @@ in
description = "NixOS manual"; description = "NixOS manual";
startOn = "udev"; startOn = "started udev";
stopOn = "shutdown";
exec = exec =
'' ''

View File

@ -43,8 +43,7 @@ in
jobs.rogue = jobs.rogue =
{ description = "Rogue dungeon crawling game"; { description = "Rogue dungeon crawling game";
startOn = "udev"; startOn = "started udev";
stopOn = "shutdown";
extraConfig = "chdir /root"; extraConfig = "chdir /root";

View File

@ -76,8 +76,8 @@ in
description = "Synergy client"; description = "Synergy client";
startOn = "network-interfaces/started"; startOn = "started network-interfaces";
stopOn = "network-interfaces/stopped"; stopOn = "stopping network-interfaces";
exec = "${pkgs.synergy}/bin/synergyc ${if cfgS.screenName == "" then "" else "-n ${cfgS.screenName}" }"; exec = "${pkgs.synergy}/bin/synergyc ${if cfgS.screenName == "" then "" else "-n ${cfgS.screenName}" }";
}; };
@ -89,8 +89,8 @@ in
description = "Synergy server"; description = "Synergy server";
startOn = "network-interfaces/started"; startOn = "started network-interfaces";
stopOn = "network-interfaces/stopped"; stopOn = "stopping network-interfaces";
exec = exec =
'' ''

View File

@ -166,8 +166,8 @@ in
description = "Nagios monitoring daemon"; description = "Nagios monitoring daemon";
startOn = "network-interfaces/started"; startOn = "started network-interfaces";
stopOn = "network-interfaces/stop"; stopOn = "stopping network-interfaces";
preStart = preStart =
'' ''

View File

@ -69,8 +69,8 @@ in
description = "Zabbix agent daemon"; description = "Zabbix agent daemon";
startOn = "network-interfaces/started"; startOn = "started network-interfaces";
stopOn = "network-interfaces/stop"; stopOn = "stopping network-interfaces";
preStart = preStart =
'' ''

View File

@ -56,8 +56,8 @@ in
description = "Zabbix server daemon"; description = "Zabbix server daemon";
startOn = "postgresql"; startOn = "started postgresql";
stopOn = "shutdown"; stopOn = "stopping postgresql";
preStart = preStart =
'' ''

View File

@ -81,8 +81,8 @@ in
description = "Kernel NFS server"; description = "Kernel NFS server";
startOn = "network-interfaces/started"; startOn = "started network-interfaces";
stopOn = "network-interfaces/stop"; stopOn = "stopping network-interfaces";
preStart = preStart =
'' ''
@ -111,8 +111,8 @@ in
description = "Kernel NFS server"; description = "Kernel NFS server";
startOn = "nfs-kernel-exports/started"; startOn = "started nfs-kernel-exports";
stopOn = "nfs-kernel-exports/stop"; stopOn = "stopping nfs-kernel-exports";
exec = "${pkgs.nfsUtils}/sbin/rpc.nfsd ${if cfg.hostName != null then "-H ${cfg.hostName}" else ""} ${builtins.toString cfg.nproc}"; exec = "${pkgs.nfsUtils}/sbin/rpc.nfsd ${if cfg.hostName != null then "-H ${cfg.hostName}" else ""} ${builtins.toString cfg.nproc}";
}; };
@ -122,8 +122,8 @@ in
description = "Kernel NFS server - mount daemon"; description = "Kernel NFS server - mount daemon";
startOn = "nfs-kernel-nfsd/started"; startOn = "started nfs-kernel-nfsd";
stopOn = "nfs-kernel-exports/stop"; stopOn = "stopping nfs-kernel-exports";
exec = "${pkgs.nfsUtils}/sbin/rpc.mountd -F -f ${exports}"; exec = "${pkgs.nfsUtils}/sbin/rpc.mountd -F -f ${exports}";
}; };
@ -133,8 +133,8 @@ in
description = "Kernel NFS server - Network Status Monitor"; description = "Kernel NFS server - Network Status Monitor";
startOn = "nfs-kernel-nfsd/started"; startOn = "started nfs-kernel-nfsd";
stopOn = "nfs-kernel-exports/stop"; stopOn = "stopping nfs-kernel-exports";
preStart = preStart =
'' ''

View File

@ -56,8 +56,8 @@ let
{ name = "samba-${appName}"; { name = "samba-${appName}";
description = "Samba Service daemon ${appName}"; description = "Samba Service daemon ${appName}";
startOn = "samba/started"; startOn = "started samba";
stopOn = "samba-control/stop"; stopOn = "stopping samba-control";
exec = "${samba}/sbin/${appName} ${args}"; exec = "${samba}/sbin/${appName} ${args}";
}; };
@ -168,8 +168,8 @@ in
{ name = "samba"; { name = "samba";
description = "Samba server"; description = "Samba server";
startOn = "network-interfaces/started"; startOn = "started network-interfaces";
stopOn = "network-interfaces/stop"; stopOn = "stopping network-interfaces";
preStart = setupScript; preStart = setupScript;
}; };

View File

@ -118,8 +118,8 @@ in
jobs.avahi_daemon = jobs.avahi_daemon =
{ name = "avahi-daemon"; { name = "avahi-daemon";
startOn = "network-interfaces/started"; startOn = "started network-interfaces";
stopOn = "network-interfaces/stop"; stopOn = "stopping network-interfaces";
script = script =
'' ''

View File

@ -67,8 +67,8 @@ in
jobs.bitlbee = jobs.bitlbee =
{ description = "BitlBee IRC to other chat networks gateway"; { description = "BitlBee IRC to other chat networks gateway";
startOn = "network-interfaces/started"; startOn = "started network-interfaces";
stopOn = "network-interfaces/stop"; stopOn = "stopping network-interfaces";
preStart = preStart =
'' ''

View File

@ -114,7 +114,6 @@ in
{ name = "ddclient"; { name = "ddclient";
startOn = "startup"; startOn = "startup";
stopOn = "shutdown";
preStart = preStart =
'' ''

View File

@ -62,8 +62,8 @@ in
config = mkIf config.networking.useDHCP { config = mkIf config.networking.useDHCP {
jobs.dhclient = jobs.dhclient =
{ startOn = "network-interfaces/started"; { startOn = "started network-interfaces";
stopOn = "network-interfaces/stop"; stopOn = "stopping network-interfaces";
preStart = preStart =
'' ''

View File

@ -111,8 +111,8 @@ in
jobs.dhcpd = jobs.dhcpd =
{ description = "DHCP server"; { description = "DHCP server";
startOn = "network-interfaces/started"; startOn = "started network-interfaces";
stopOn = "network-interfaces/stop"; stopOn = "stopping network-interfaces";
script = script =
'' ''

View File

@ -54,8 +54,8 @@ in
jobs.ejabberd = jobs.ejabberd =
{ description = "EJabberd server"; { description = "EJabberd server";
startOn = "network-interface/started"; startOn = "started network-interface";
stopOn = "network-interfaces/stop"; stopOn = "stopping network-interfaces";
preStart = preStart =
'' ''

View File

@ -79,7 +79,7 @@ in
environment.systemPackages = [pkgs.iptables]; environment.systemPackages = [pkgs.iptables];
jobs.firewall = jobs.firewall =
{ startOn = "network-interfaces/started"; { startOn = "started network-interfaces";
preStart = preStart =
'' ''

View File

@ -194,8 +194,8 @@ in
jobs.gnunetd = jobs.gnunetd =
{ description = "The GNUnet Daemon"; { description = "The GNUnet Daemon";
startOn = "network-interfaces/started"; startOn = "started network-interfaces";
stopOn = "network-interfaces/stop"; stopOn = "stopping network-interfaces";
preStart = preStart =
'' ''

View File

@ -134,8 +134,8 @@ in
jobs.gw6c = jobs.gw6c =
{ description = "Gateway6 client"; { description = "Gateway6 client";
startOn = if cfg.autorun then "network-interfaces/started" else ""; startOn = if cfg.autorun then "started network-interfaces" else "";
stopOn = "network-interfaces/stop"; stopOn = "stopping network-interfaces";
exec = "${gw6cService}/bin/control start"; exec = "${gw6cService}/bin/control start";
}; };

View File

@ -58,8 +58,8 @@ in
jobs.ifplugd = jobs.ifplugd =
{ description = "Network interface connectivity monitor"; { description = "Network interface connectivity monitor";
startOn = "network-interfaces/started"; startOn = "started network-interfaces";
stopOn = "network-interfaces/stop"; stopOn = "stopping network-interfaces";
exec = exec =
'' ''

View File

@ -122,8 +122,8 @@ in
description = "IRCD Hybrid server"; description = "IRCD Hybrid server";
startOn = "${startingDependency}/started"; startOn = "started ${startingDependency}";
stopOn = "${startingDependency}/stop"; stopOn = "stopping ${startingDependency}";
exec = "${ircdService}/bin/control start"; exec = "${ircdService}/bin/control start";
}; };

View File

@ -52,8 +52,7 @@ in
jobs.openfire = jobs.openfire =
{ description = "OpenFire XMPP server"; { description = "OpenFire XMPP server";
startOn = "${startDependency}/started"; startOn = "started ${startDependency}";
stopOn = "shutdown";
script = script =
'' ''

View File

@ -66,8 +66,8 @@ in
jobs.portmap = jobs.portmap =
{ description = "ONC RPC portmap"; { description = "ONC RPC portmap";
startOn = "network-interfaces/started"; startOn = "started network-interfaces";
stopOn = "network-interfaces/stop"; stopOn = "stopping network-interfaces";
exec = exec =
'' ''

View File

@ -81,7 +81,6 @@ in
{ name = "privoxy"; { name = "privoxy";
startOn = "startup"; startOn = "startup";
stopOn = "shutdown";
preStart = preStart =
'' ''

View File

@ -119,8 +119,8 @@ in
jobs.lshd = jobs.lshd =
{ description = "GNU lshd SSH2 daemon"; { description = "GNU lshd SSH2 daemon";
startOn = "network-interfaces/started"; startOn = "started network-interfaces";
stopOn = "network-interfaces/stop"; stopOn = "stopping network-interfaces";
environment = environment =
{ LD_LIBRARY_PATH = config.system.nssModules.path; }; { LD_LIBRARY_PATH = config.system.nssModules.path; };

View File

@ -102,8 +102,8 @@ in
jobs.vsftpd = jobs.vsftpd =
{ description = "vsftpd server"; { description = "vsftpd server";
startOn = "network-interfaces/started"; startOn = "started network-interfaces";
stopOn = "network-interfaces/stop"; stopOn = "stopping network-interfaces";
preStart = preStart =
'' ''

View File

@ -38,8 +38,8 @@ in
environment.systemPackages = [pkgs.wpa_supplicant]; environment.systemPackages = [pkgs.wpa_supplicant];
jobs.wpa_supplicant = jobs.wpa_supplicant =
{ startOn = "network-interfaces/started"; { startOn = "started network-interfaces";
stopOn = "network-interfaces/stop"; stopOn = "stopping network-interfaces";
preStart = preStart =
'' ''

View File

@ -122,8 +122,8 @@ in
jobs.xinetd = jobs.xinetd =
{ description = "xinetd server"; { description = "xinetd server";
startOn = "network-interfaces/started"; startOn = "started network-interfaces";
stopOn = "network-interfaces/stop"; stopOn = "stopping network-interfaces";
exec = "${xinetd}/sbin/xinetd -syslog daemon -dontfork -stayalive -f ${configFile}"; exec = "${xinetd}/sbin/xinetd -syslog daemon -dontfork -stayalive -f ${configFile}";
}; };

View File

@ -160,8 +160,8 @@ in
jobs.cupsd = jobs.cupsd =
{ description = "CUPS printing daemon"; { description = "CUPS printing daemon";
startOn = "network-interfaces/started"; startOn = "started network-interfaces";
stopOn = "network-interfaces/stop"; stopOn = "stopping network-interfaces";
preStart = preStart =
'' ''

View File

@ -67,7 +67,6 @@ in
{ description = "at daemon (atd)"; { description = "at daemon (atd)";
startOn = "startup"; startOn = "startup";
stopOn = "shutdown";
preStart = preStart =
'' ''
@ -97,12 +96,12 @@ in
chown atd:atd "$jobdir"/.SEQ && \ chown atd:atd "$jobdir"/.SEQ && \
chmod 600 "$jobdir"/.SEQ chmod 600 "$jobdir"/.SEQ
fi fi
# `atd' doesn't have a no-fork flag, so start it here. !!!
# Fix this once we have Upstart 0.6.
${at}/sbin/atd
''; '';
daemonType = "fork";
exec = "${at}/sbin/atd";
postStop = postStop =
'' ''
test -e /var/run/atd.pid && kill $(cat /var/run/atd.pid) test -e /var/run/atd.pid && kill $(cat /var/run/atd.pid)

View File

@ -70,7 +70,6 @@ in
{ description = "Cron daemon"; { description = "Cron daemon";
startOn = "startup"; startOn = "startup";
stopOn = "shutdown";
# Needed to interpret times in the local timezone. # Needed to interpret times in the local timezone.
environment = { TZ = config.time.timeZone; }; environment = { TZ = config.time.timeZone; };

View File

@ -101,7 +101,6 @@ in
{ description = "fcron daemon"; { description = "fcron daemon";
startOn = "startup"; startOn = "startup";
stopOn = "shutdown";
environment = environment =
{ PATH = "/var/run/current-system/sw/bin"; { PATH = "/var/run/current-system/sw/bin";

View File

@ -21,7 +21,6 @@ in
{ description = "Name Service Cache Daemon"; { description = "Name Service Cache Daemon";
startOn = "startup"; startOn = "startup";
stopOn = "shutdown";
environment = { LD_LIBRARY_PATH = nssModulesPath; }; environment = { LD_LIBRARY_PATH = nssModulesPath; };

View File

@ -53,7 +53,6 @@ in
{ description = "Uptimed daemon"; { description = "Uptimed daemon";
startOn = "startup"; startOn = "startup";
stopOn = "shutdown";
preStart = preStart =
'' ''

View File

@ -41,8 +41,7 @@ in
jobs.gpm = jobs.gpm =
{ description = "General purpose mouse"; { description = "General purpose mouse";
startOn = "udev"; startOn = "started udev";
stopOn = "shutdown";
exec = "${pkgs.gpm}/sbin/gpm -m /dev/input/mice -t ${cfg.protocol} -D &>/dev/null"; exec = "${pkgs.gpm}/sbin/gpm -m /dev/input/mice -t ${cfg.protocol} -D &>/dev/null";
}; };

View File

@ -450,8 +450,7 @@ in
description = "Apache HTTPD"; description = "Apache HTTPD";
startOn = "${startingDependency}/started"; startOn = "started ${startingDependency}";
stopOn = "shutdown";
environment = environment =
{ # !!! This should be added in test-instrumentation.nix. It { # !!! This should be added in test-instrumentation.nix. It

View File

@ -104,8 +104,8 @@ in
jobs.tomcat = jobs.tomcat =
{ description = "Apache Tomcat server"; { description = "Apache Tomcat server";
startOn = "network-interface/started"; startOn = "started network-interface";
stopOn = "network-interfaces/stop"; stopOn = "stopping network-interfaces";
preStart = preStart =
'' ''

View File

@ -43,8 +43,7 @@ in
jobs.xfs = jobs.xfs =
{ description = "X Font Server"; { description = "X Font Server";
startOn = "${startingDependency}/started"; startOn = "started ${startingDependency}";
stopOn = "shutdown";
exec = "${pkgs.xorg.xfs}/bin/xfs -config ${configFile}"; exec = "${pkgs.xorg.xfs}/bin/xfs -config ${configFile}";
}; };

View File

@ -360,7 +360,7 @@ in
optional (elem "virtualbox" driverNames) kernelPackages.virtualboxGuestAdditions; optional (elem "virtualbox" driverNames) kernelPackages.virtualboxGuestAdditions;
jobs.xserver = jobs.xserver =
{ startOn = if cfg.autorun then "hal" else "never"; { startOn = if cfg.autorun then "started hal" else "";
environment = environment =
{ FONTCONFIG_FILE = "/etc/fonts/fonts.conf"; # !!! cleanup { FONTCONFIG_FILE = "/etc/fonts/fonts.conf"; # !!! cleanup