Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines
Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.
REPEAT: Do NOT report bugs for outdated packages!
https://wiki.archlinux.org/title/Bug_reporting_guidelines
Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.
REPEAT: Do NOT report bugs for outdated packages!
FS#22946 - [initscripts] internal: add killproc function
Attached to Project:
Arch Linux
Opened by Thomas S Hatch (thatch45) - Friday, 18 February 2011, 04:44 GMT
Last edited by Tom Gundersen (tomegun) - Tuesday, 08 May 2012, 12:43 GMT
Opened by Thomas S Hatch (thatch45) - Friday, 18 February 2011, 04:44 GMT
Last edited by Tom Gundersen (tomegun) - Tuesday, 08 May 2012, 12:43 GMT
|
DetailsThis never came up running Arch on my servers at home and on my laptop, but now that I am running thousands of virtual machines with miles of automation scripts murphy's law is rearing it's ugly head.
The problem I am running into is the fact that many Arch init scripts don't block until they are finished killing a process. So what happens is that restarts fail to start because the daemon has not always stopped before the start is called. Also, some automation systems (like puppet) don't always call restart, but sometimes call stop and then start. My argument is that using a sleep call in an init script's restart call is non deterministic behavior and we can do better. My proposal for a fix to this problem is to add a killproc function to the default functions, I have attached an idea for one, but think it is a subject worth discussing. Basically, it waits until the pid in question dies, but can stat a failure if the pid does not die, and can take an optional parameter to use a signal 9 if the normal signal 15 does not work. This file and a little script to test it out are also available in my gihub: https://github.com/thatch45/sandbox/tree/master/arch-rc |
This task depends upon
killproc.sh
Comments: Initscripts recently moved to use the bash [[ constructs in favor of the posix [, for coding style consistency, those should be used here, too.