mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-25 15:11:35 +00:00
* Support pre-stop scripts. These are needed to cleanly shutdown
daemons such as Apache or PostgreSQL. svn path=/nixos/branches/upstart-0.6/; revision=18234
This commit is contained in:
parent
83a9bf9a6a
commit
d7342c78d4
|
@ -480,7 +480,14 @@ in
|
|||
done
|
||||
'';
|
||||
|
||||
exec = "${httpd}/bin/httpd -f ${httpdConf} -DNO_DETACH";
|
||||
daemonType = "fork";
|
||||
|
||||
exec = "${httpd}/bin/httpd -f ${httpdConf}";
|
||||
|
||||
preStop =
|
||||
''
|
||||
${httpd}/bin/httpd -f ${httpdConf} -k graceful-stop
|
||||
'';
|
||||
};
|
||||
|
||||
};
|
||||
|
|
|
@ -72,6 +72,12 @@ let
|
|||
${optionalString job.task "task"}
|
||||
${optionalString job.respawn "respawn"}
|
||||
|
||||
${optionalString (job.preStop != "") ''
|
||||
pre-stop script
|
||||
${job.preStop}
|
||||
end script
|
||||
''}
|
||||
|
||||
${optionalString (job.postStop != "") ''
|
||||
post-stop script
|
||||
${job.postStop}
|
||||
|
@ -165,6 +171,16 @@ let
|
|||
'';
|
||||
};
|
||||
|
||||
preStop = mkOption {
|
||||
type = types.string;
|
||||
default = "";
|
||||
description = ''
|
||||
Shell commands executed before the job is stopped
|
||||
(i.e. before Upstart kills the job's main process). This can
|
||||
be used to cleanly shut down a daemon.
|
||||
'';
|
||||
};
|
||||
|
||||
postStop = mkOption {
|
||||
type = types.string;
|
||||
default = "";
|
||||
|
|
Loading…
Reference in a new issue