* Upstart stupidly doesn't kill post-start scripts if we do "stop
JOB", but it does kill the job's main process. So if the post-start script if waiting for the job's main process to reach some state, it may hang forever. Thus, the post-start script should monitor whether its job has been requested to stop and exit in that case. svn path=/nixos/trunk/; revision=33176
This commit is contained in:
parent
67a90c6d6f
commit
646d67465c
@ -87,7 +87,10 @@ in
|
|||||||
''
|
''
|
||||||
# Portmap forks into the background before it starts
|
# Portmap forks into the background before it starts
|
||||||
# listening, so wait until its ready.
|
# listening, so wait until its ready.
|
||||||
while ! nc -z localhost 111; do sleep 1; done
|
while ! nc -z localhost 111; do
|
||||||
|
if [[ "$(status)" =~ stop/ ]]; then exit; fi
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user