Bug 617320
Summary: | Providing native systemd file for upcoming F14 Feature Systemd | ||||||
---|---|---|---|---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Jóhann B. Guðmundsson <johannbg> | ||||
Component: | at | Assignee: | Marcela Mašláňová <mmaslano> | ||||
Status: | CLOSED RAWHIDE | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | ||||
Severity: | medium | Docs Contact: | |||||
Priority: | low | ||||||
Version: | 14 | CC: | jpopelka, lpoetter, mkkp4x4, mmaslano, plautrba, tomek | ||||
Target Milestone: | --- | Keywords: | Reopened | ||||
Target Release: | --- | ||||||
Hardware: | All | ||||||
OS: | Linux | ||||||
Whiteboard: | |||||||
Fixed In Version: | at-3.1.12-7.fc15 | Doc Type: | Bug Fix | ||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | Environment: | ||||||
Last Closed: | 2010-12-07 13:42:04 UTC | Type: | --- | ||||
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
Jóhann B. Guðmundsson
2010-07-22 19:01:07 UTC
For SysVinit scripts exist Guidelines with example. I'm waiting for something short and comprehensible with functional example init script. I have only two questions, because I didn't read whole fedora-devel thread about systemd. 1. Why atd -f? Daemons will be running in foreground? Why? 2. Did you notice that at daemon has sysconfig file, where are stored quite useful options? In case systemd won't read sysconfig files, where will be stored setting? This bug appears to have been reported against 'rawhide' during the Fedora 14 development cycle. Changing version to '14'. More information and reason for this action is here: http://fedoraproject.org/wiki/BugZappers/HouseKeeping Regarding your issue #1: If daemons fork away then systemd would not know which is the main process of the daemon which makes it hard supervising it: i.e. restart it if it crashed, collect crash information and so on. By setting "-f" we make sure that at is started and the process systemd fork is the main process of at. Regarding issue 2#: it is easy to add support for sysconfig files to the service file. Simply use the EnvironmentFile= directive to import the env vars and then use $OPTS to refer to them in the command line. The result would look something like this: <snip> [Unit] Description=Execution Queue Daemon After=syslog.target [Service] EnvironmentFile=/etc/sysconfig/atd ExecStart=/usr/sbin/atd -f $OPTS [Install] WantedBy=multi-user.target </snip> BTW, it is not sufficient to just drop the .service files into /lib/systemd/system. It is also necessary to enable it when upgrading from an old sysv-only rpm. How to implement that in the spec file with minimal work is documented in daemon(7): http://0pointer.de/public/systemd-man/daemon.html#id2562029 *** Bug 656869 has been marked as a duplicate of this bug. *** +1 for Lennart's version https://bugzilla.redhat.com/show_bug.cgi?id=617320#c4 (In reply to comment #1) > For SysVinit scripts exist Guidelines with example. I'm waiting for something > short and comprehensible with functional example init script. BTW, we now have a (draft still) package guideline for systemd: https://fedoraproject.org/wiki/Systemd_Packaging_Draft#Scriptlets Marcelo, I'm not sure this is fixed. (In reply to comment #2) > I have only two questions, because I didn't read whole fedora-devel thread > about systemd. > > 1. Why atd -f? Daemons will be running in foreground? Why? Why did you use '-n' instead of '-f' in ExecStart=/usr/sbin/atd -n $OPTS I don't see '-n' option in atd(8). Also the service doesn't start with it. - ExecStart=/usr/sbin/atd -n $OPTS + ExecStart=/usr/sbin/atd -f $OPTS fixes the problem. > 2. Did you notice that at daemon has sysconfig file, where are stored quite > useful options? In case systemd won't read sysconfig files, where will be > stored setting? When un-commenting the example OPTS="-l 4 -b 120" in /etc/sysconfig/atd the service also refuses to start. Removing the quotation marks OPTS=-l 4 -b 120 fixes the problem. But this is only a work-around. I think it is systemd who should be stripping off the quotation marks. Lennart, what do you think ? Quotation mark striping is different for ${OPTS} and $OPTS. Difference is described in man systemd.service, at the end of ExecStart= paragraph. (In reply to comment #10) > Quotation mark striping is different for ${OPTS} and $OPTS. Difference is > described in man systemd.service, at the end of ExecStart= paragraph. Well, I already tried ${OPTS} and it seemed to me that there's no difference. systemctl show atd.service shows: <snip> LoadState=loaded ActiveState=failed SubState=failed <snip> ExecStart={ path=/usr/sbin/atd ; argv[]=/usr/sbin/atd -f ${OPTS} ; ignore=no ; start_time=[Tue, 07 Dec 2010 12:27:55 +0100] ; stop_time=[n/a] ; pid=908 ; code=(null) ; status=0/ } Environment=OPTS="-l 4 -b 120" <snip> Whoops. Now it's ok with ExecStart=/usr/sbin/atd -f $OPTS OPTS="-l 4 -b 120" I don't have any idea what was wrong but for now you can probably ignore my comments about the quotation marks. "I don't have any idea what was wrong but for now you can probably ignore my comments about the quotation marks." Have you reloaded systemd? systemctl --system daemon-reload If not, then OPTS=-l 4 -b 120 is still cached Yes, I always reloaded it. And always checked with 'systemctl show' which shows what's in $OPTS. I have also created systemd service files for dhcpd/dhcpd6/dhcrelay. I saw exactly the same behaviour trying to run them couple days ago and now they work like a charm. strange Calling systemctl --system daemon-reload and service atd restart is in my opinion weird, but it's working for me. |