Bug 809360
Summary: | sd_notifyf doesn't work as expected for httpd | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Jan Kaluža <jkaluza> | ||||||||
Component: | systemd | Assignee: | Michal Sekletar <msekleta> | ||||||||
Status: | CLOSED WORKSFORME | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | ||||||||
Severity: | unspecified | Docs Contact: | |||||||||
Priority: | unspecified | ||||||||||
Version: | rawhide | CC: | johannbg, jorton, jskarvad, lpoetter, metherid, msekleta, notting, plautrba, systemd-maint | ||||||||
Target Milestone: | --- | ||||||||||
Target Release: | --- | ||||||||||
Hardware: | Unspecified | ||||||||||
OS: | Unspecified | ||||||||||
Whiteboard: | |||||||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||||||
Doc Text: | Story Points: | --- | |||||||||
Clone Of: | Environment: | ||||||||||
Last Closed: | 2013-01-15 22:49:45 UTC | Type: | Bug | ||||||||
Regression: | --- | Mount Type: | --- | ||||||||
Documentation: | --- | CRM: | |||||||||
Verified Versions: | Category: | --- | |||||||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||||
Cloudforms Team: | --- | Target Upstream Version: | |||||||||
Embargoed: | |||||||||||
Attachments: |
|
Description
Jan Kaluža
2012-04-03 08:06:35 UTC
Adding reproducer. I believe this should work with sd_notifyf, shouldn't it? Created attachment 610232 [details]
simple reproducer
There is also variation of this reproducer showing different problem. If I keep parent process running and try to update STATUS from child process, it is not reflected in systemctl status output. I still see "Status: "Processing requests..." there. From the documentation I would expect it will work even called from the child: If the unset_environment parameter is non-zero sd_notify() will unset the $NOTIFY_SOCKET environment variable before returning (regardless whether the function call itself succeeded or not). Further calls to sd_notify() will then fail, but the variable is no longer inherited by child processes. Created attachment 610248 [details]
reproducer for second problem
For the first reproducer I would expect that systemd will wait some time for sd_notify call and it will not care from which children process it comes. I thought that's exactly why sd_notify exists. Currently it kills children when main process terminates. Hmm, you set Type=notify, but you actually have a forking process, right? You need to set Type=forking in that case, otherwise systemd will assume your main process is dead and terminate you immediately. You also need to set NotifyAccess=all if it is not the original process that sends off the message Hm, I think we could close this bug. I remember having discussion about this with someone from systemd community and find out the current systemd behaviour is good. In httpd we've fixed it by using -DFOREGROUND httpd option, so httpd does not fork and Type=notify can be used. Feel free to close this bug. Cool, thanks! |