Arch Linux

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!
Tasklist

FS#21586 - [lighttpd] restart never works in rc.d

Attached to Project: Arch Linux
Opened by Dan McGee (toofishes) - Thursday, 04 November 2010, 01:35 GMT
Last edited by Pierre Schmitz (Pierre) - Tuesday, 16 November 2010, 12:46 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Pierre Schmitz (Pierre)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
`/etc/rc.d/lighttpd restart` never works due to the delay (`sleep 3`) removed in r89167.

Additional info:
* lighttpd/1.4.28

Steps to reproduce:
1. Try a restart; I think it may be more easily reproducible if you are using something like fcgi and spawned threads.
2. See this:
$ sudo /etc/rc.d/lighttpd restart
:: Checking configuration [DONE]
:: Stopping lighttpd [DONE]
:: Starting lighttpd [FAIL]

$ sudo /etc/rc.d/lighttpd restart
:: Checking configuration [DONE]
:: Stopping lighttpd [FAIL]

$ sudo /etc/rc.d/lighttpd start
:: Checking configuration [DONE]
:: Starting lighttpd [DONE]

Patch attached that does something slightly better than the old code; it will sleep for one second at a time until it detects the process is done and then will start it up again.

FYI: there is another rather annoying "feature" this init script exhibits that I did not fix- when you call restart but it is not already running, it fails and then doesn't start at all, which is contrary to almost all other init scripts.
This task depends upon

Closed by  Pierre Schmitz (Pierre)
Tuesday, 16 November 2010, 12:46 GMT
Reason for closing:  Fixed
Comment by Gaetan Bisson (vesath) - Thursday, 04 November 2010, 09:41 GMT
(Untested:) Why not use "wait $(get_pid)"?
Comment by Pierre Schmitz (Pierre) - Thursday, 04 November 2010, 10:41 GMT
Wait cannot be used as it seems to only work on child processes of the calling process.

I have fixed these two bugs in 1.4.28-3. Good catch; seems to be never happened to me. In most cases using reload instead of restart might be a better option btw..
Comment by Dan McGee (toofishes) - Thursday, 04 November 2010, 13:02 GMT
Sure, I normally use reload, but restart is usually a good choice when upgrading libraries or binaries on the system to ensure the new ones are getting used.

Loading...