Upstart script "restart" won't restart service
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
xinetd (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: xinetd
# stop xinetd
xinetd stop/waiting
# start xinetd
xinetd start/running, process 9378
# restart xinetd
xinetd start/running, process 9378
I must stop(8) then start(8) it to restart.
I investigate the upstart script at /etc/init/
pre-stop script
xinetd_
[ -n "${xinetd_pid}" ] || exit 0
kill -QUIT "${xinetd_pid}"
end script
The first line gets nothing when invoking restart. I think that's because awk cannot match the pattern when invoing 'restart'. It matches when invoking 'stop'. I think using /var/run/xinetd.pid is safe. Changed it to this:
pre-stop script
xinetd_pid=$(cat /var/run/
[ -n "${xinetd_pid}" ] || exit 0
kill -QUIT "${xinetd_pid}"
end script
This will stop the service but won't start it when invoking 'restart'. I do not know the internals of upstart. This may because the pre-stop exit with a non-zero status and 'restart' just killed it and cannot start it?
To fix the problem in the bug summary , I have to comment out the pre-stop script, and 'restart' works OK. I see bug 605007, the author need SIGQUIT, but in my way SIGQUIT is not explicitly sent. I do not know why SIGQUIT is needed.
IMHO, this script needs a fix. But I haven't figured out a good patch. Thank you guys.
My version is 2.3.14-7ubuntu4 in natty.