Bug 684175 - Providing native systemd file for upcoming F15 Feature Systemd
Summary: Providing native systemd file for upcoming F15 Feature Systemd
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: httpd
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Joe Orton
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 714568 (view as bug list)
Depends On:
Blocks: SysVtoSystemd
TreeView+ depends on / blocked
 
Reported: 2011-03-11 11:43 UTC by Jóhann B. Guðmundsson
Modified: 2012-02-13 19:40 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-02-13 19:40:44 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Native systemd service file for apache (499 bytes, text/plain)
2011-03-11 11:43 UTC, Jóhann B. Guðmundsson
no flags Details
httpd-worker.service (522 bytes, text/plain)
2011-03-11 13:49 UTC, Jóhann B. Guðmundsson
no flags Details
Native systemd file for the apache mpm prefork (432 bytes, text/plain)
2011-03-29 19:36 UTC, Jóhann B. Guðmundsson
no flags Details
Native systemd file for the apache mpm event (450 bytes, text/plain)
2011-03-29 19:38 UTC, Jóhann B. Guðmundsson
no flags Details
Native systemd file for the apache mpm worker (455 bytes, text/plain)
2011-03-29 19:39 UTC, Jóhann B. Guðmundsson
no flags Details
Resubmitting with correct WantedBy for service (455 bytes, text/plain)
2011-03-29 19:47 UTC, Jóhann B. Guðmundsson
no flags Details
Resubmitting with correct WantedBy for service. (460 bytes, text/plain)
2011-03-29 19:48 UTC, Jóhann B. Guðmundsson
no flags Details
All three service files. (468 bytes, application/x-gzip)
2011-04-12 13:41 UTC, Jóhann B. Guðmundsson
no flags Details

Description Jóhann B. Guðmundsson 2011-03-11 11:43:31 UTC
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:

Comment 1 Joe Orton 2011-03-11 11:54:18 UTC
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.

Comment 2 Jóhann B. Guðmundsson 2011-03-11 13:02:05 UTC
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.

Comment 3 Jóhann B. Guðmundsson 2011-03-11 13:31:55 UTC
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?

Comment 4 Jóhann B. Guðmundsson 2011-03-11 13:49:49 UTC
Created attachment 483719 [details]
httpd-worker.service

Comment 5 Jóhann B. Guðmundsson 2011-03-11 15:06:10 UTC
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"

Comment 6 Jóhann B. Guðmundsson 2011-03-22 16:28:44 UTC
Ping?

Comment 7 Joe Orton 2011-03-22 16:45:33 UTC
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.

Comment 8 Jóhann B. Guðmundsson 2011-03-22 17:55:08 UTC
> 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.

Comment 9 Joe Orton 2011-03-29 12:36:28 UTC
See use of %{mpms} in the spec file.

Comment 10 Jóhann B. Guðmundsson 2011-03-29 19:36:48 UTC
Created attachment 488538 [details]
Native systemd file for the apache mpm prefork

Comment 11 Jóhann B. Guðmundsson 2011-03-29 19:38:13 UTC
Created attachment 488539 [details]
Native systemd file for the apache mpm event

Comment 12 Jóhann B. Guðmundsson 2011-03-29 19:39:09 UTC
Created attachment 488541 [details]
Native systemd file for the apache mpm worker

Comment 13 Jóhann B. Guðmundsson 2011-03-29 19:42:39 UTC
Added native systemd service files for mpm events.
Renamed the services files as mentioned in comment 7.
Shorten the Description field.

Comment 14 Jóhann B. Guðmundsson 2011-03-29 19:47:02 UTC
Created attachment 488547 [details]
Resubmitting with correct WantedBy for service

Comment 15 Jóhann B. Guðmundsson 2011-03-29 19:48:02 UTC
Created attachment 488548 [details]
Resubmitting with correct WantedBy for service.

Comment 16 Jóhann B. Guðmundsson 2011-04-12 12:28:58 UTC
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.

Comment 17 Joe Orton 2011-04-12 12:34:33 UTC
Go ahead and push the changes if they are complete, I presume you are provenpackager?

Comment 18 Jóhann B. Guðmundsson 2011-04-12 13:02:47 UTC
You presume wrong. 

I thought you were testing it since it is rather high profile and perhaps discussing it upstream?

Comment 19 Jóhann B. Guðmundsson 2011-04-12 13:41:25 UTC
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.

Comment 20 Joe Orton 2011-04-12 14:47:10 UTC
(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!

Comment 21 Tomasz Torcz 2011-04-14 09:02:22 UTC
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.

Comment 22 Joe Orton 2011-04-14 15:45:18 UTC
Thanks Tomasz, pushed -13 to fix that.

Comment 23 Bill Nottingham 2011-04-26 17:36:00 UTC
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

Comment 24 Elad Alfassa 2011-06-20 06:18:44 UTC
*** Bug 714568 has been marked as a duplicate of this bug. ***

Comment 25 Jóhann B. Guðmundsson 2011-07-11 16:16:35 UTC
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 :)

Comment 26 Gwyn Ciesla 2012-02-13 19:40:44 UTC
Looks like this is complete as of 1/16/2012, with a correction 1/23/2012.


Note You need to log in before you can comment on or make changes to this bug.