Created attachment 483693 [details] Native systemd service file for apache Description of problem: The attached file is a native systemd file for upcoming F15 Feature [1] Please read [2] on how to packaging and installing systemd Service files. To learn more about Systemd daemon see [3]. To view old SysV with the new Systemd site by site see for your component see [4] If you have any question dont hesitate to ask them on this bug report. 1.http://fedoraproject.org/wiki/Features/systemd 2.https://fedoraproject.org/wiki/Systemd_Packaging_Draft 3.http://0pointer.de/public/systemd-man/daemon.html 4.https://fedoraproject.org/wiki/User:Johannbg/QA/Systemd/compatability Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: 1. 2. 3. Actual results: Expected results: Additional info:
This needs to allow override of $HTTPD, is that possible? Are those Exec* statements evaluated by /bin/sh or internally? We'd need something like ${HTTPD-/usr/sbin/httpd} in place of simply /usr/sbin/httpd. Alternatively I guess separate service files for the separate executables.
Could you give me a bit of bigger picture what's happening here why it's needed and which executable replace httpd so I can try to figure out what is the best solution for this.
Ah I think I've figured it out. Is it not best to have two different service files one httpd.service and another one httpd-worker.service and the httpd service only enabled by default?
Created attachment 483719 [details] httpd-worker.service
There is a way around if necessary which is discourage and not recommended except for some exceptional cases due to some SELinux implications. Then you would replace Exec{Start/Reload/Restart/Stop}= with something in the line of /bin/bash -c "exec ${HTTPD-/usr/sbin/httpd} $OPTIONS -k start/restart/stop"
Ping?
By "SELinux implications" you mean httpd would lose SELinux support, right? The transition to httpd_t would never happen if executed by bash IIUC. So that's off the table. We'd need service files for all three MPMs, best to loop and use %{mpms}. https://fedoraproject.org/wiki/TomCallaway/Systemd_Revised_Draft says the naming should be "apache-httpd", not "httpd". I'm not sure what you mean by "enabled by default". None of these daemons should be starting at boot by default.
> We'd need service files for all three MPMs, best to loop and use %{mpms}. What's the third one? And what do you mean by loop and use %{mpms}? > https://fedoraproject.org/wiki/TomCallaway/Systemd_Revised_Draft > > says the naming should be "apache-httpd", not "httpd". We want to create and push the systemd service files and get them accepted upstreams if possible so it should reflect how upstream wants it as in it should be named the same on all distro's I would think. > I'm not sure what you mean by "enabled by default". None of these daemons > should be starting at boot by default. Yes you are correct.
See use of %{mpms} in the spec file.
Created attachment 488538 [details] Native systemd file for the apache mpm prefork
Created attachment 488539 [details] Native systemd file for the apache mpm event
Created attachment 488541 [details] Native systemd file for the apache mpm worker
Added native systemd service files for mpm events. Renamed the services files as mentioned in comment 7. Shorten the Description field.
Created attachment 488547 [details] Resubmitting with correct WantedBy for service
Created attachment 488548 [details] Resubmitting with correct WantedBy for service.
It would be good if you can push this into rawhide we are converting more than this script and need to add for example Conflicts= encase they conflict with the apache daemon.
Go ahead and push the changes if they are complete, I presume you are provenpackager?
You presume wrong. I thought you were testing it since it is rather high profile and perhaps discussing it upstream?
Created attachment 491483 [details] All three service files. Now I've compressed the final native systemd service files and tested starting stopping and restarting all three of them and they all do so cleanly. To test you need to be on F15 or rawhide uncompress them into /lib/systemd/system/ directory. Then run systemctl daemon-reload systemctl start apache-mpm-$foo.service to start a service systemctl stop apache-mpm-$foo.service to stop a service systemctl restart apache-mpm-$foo.service to restart a service And systemctl enable ( or disable ) apache-mpm-$foo.service to enable/disable a service Given that we now created a three seperated service files along with renaming them commands such as service httpd $foo or chkconfig httpd $foo wont work.
(In reply to comment #19) > Created attachment 491483 [details] > All three service files. Thanks a lot. > Given that we now created a three seperated service files along with renaming > them commands such as service httpd $foo or chkconfig httpd $foo wont work. I didn't realise that... and I don't think that'd be acceptable really. I've renamed them to httpd (prefork, default), httpd-worker and httpd-event, and pushed this to F16. Testing welcome!
Unit files shipped in rawhide's httpd-2.2.17-12.fc16.x86_64 are malformed: ExecStart=%{sbindir}/httpd $OPTIONS -k start ExecReload=%{sbindir}/httpd $OPTIONS -t ExecReload=/bin/kill -HUP $MAINPID ExecStop=%{sbindir}/httpd $OPTIONS -k stop Those macros should've been expanded. Systemd requires full paths.
Thanks Tomasz, pushed -13 to fix that.
Moving systemd service RFEs to rawhide. At this point, it is not appropriate in the Fedora 15 cycle to add these. Furthermore, at this point, we are still finalizing the packaging guidelines to handle SysV -> systemd upgrades. We therefore request: - wait until there are packaging guidelines (this will be announced on the devel list). This ensures that upgrades will work smoothly and we/you won't have to do multiple sets of changes. - work on these sorts of changes for Fedora 16 where necessary, not Fedora 15, as we're trying to fix things for release. - do *not* change a service from SysV to systemd in an existing release (such as Fedora 15), as this is the sort of behavior change that goes against our update policy, documented as https://fedoraproject.org/wiki/Updates_Policy
*** Bug 714568 has been marked as a duplicate of this bug. ***
Joe you need to update you spec file to either drop or subpackage the legacy sysv init script as stated in the now existing official guidelines for systemd https://fedoraproject.org/wiki/Packaging:Guidelines:Systemd https://fedoraproject.org/wiki/Packaging:ScriptletSnippets#Systemd https://fedoraproject.org/wiki/Packaging:Tmpfiles.d Ones fixed please close this bug :)
Looks like this is complete as of 1/16/2012, with a correction 1/23/2012.