[Bug 772327] [NEW] Upstart script "restart" won't restart service

Pan Yongzhi panyongzhi at gmail.com
Thu Apr 28 12:34:24 UTC 2011


Public bug reported:

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/xinetd.conf. The pre-stop
script  is:

pre-stop script
  xinetd_pid=$(status | awk '/stop\/pre-stop/ { print $NF }')
  [ -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/xinetd.pid)
  [ -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.

** Affects: xinetd (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to xinetd in Ubuntu.
https://bugs.launchpad.net/bugs/772327

Title:
  Upstart script "restart" won't restart service



More information about the Ubuntu-server-bugs mailing list