Systemd is the new Fedora init system. We need to document the following areas for packagers and system administrators:
- Scriptlets for systemd -- these go in the spec files so we need them
- How to write unit files -- packagers often get stuck writing init scripts for starting services. Since systemd is new, it'll be even more so.
Also need to make some decisions:
- Requirement for sysvinit scripts -- Should we drop this or change it to all packages must be configured to work with the default init system?
- Services must not be started without explicit admin action (not just installing) -- Should we drop this? How does this interact with bus activation?
Foundational decisions
SysVinit requirement
I justify the current guidelines requirement for a SysVinit script to be that there is an init script for the default initsystem. With this idea in mind, I'd change the requirement to be "There must be a init configuration for the default Fedora init system. In Fedora < 14, that's upstart (which understands sysVinit scripts and event files). In Fedora 14 or greater, that's systemd which understands sysvinit scripts or unit files.
There's another argument for SysVinit scripts -- they're often a lowest common denominator among people wanting to switch between init systems. (At least, upstart, SysVinit, and systemd in Fedora). If that's the reason then we should probably include that rationale in the guideline. We also should consider how the sysvinit script is to be tested. Does the sysvinit script override a systemd unit file? Do we have QA test booting Fedora with upstart? If we don't test that the init scripts work, I think that the argument that the init scripts are there for compatibility becomes much weaker.
Service start
Currently the Guidelines tell packagers not to start services when they install. The system administrator must do that themselves. There are a few updates that need to be done here:
- Do we want this at all? -- I think the answer is yes.
- Are there some exceptions? -- I think the answer is yes even now. Certain services are so core to how Linux works so we enable them when we install them. We need to come up with two things:
- a list of programs that we knowingly want this to be the case for.
- pick out the characteristics of those programs so we can write a Guidelines that people can use to judge if their service should start by itself or not.
Scriptlets
Writing unit files
I'm not very informed in this area. We need to know:
- which options are necessary and which are optional
- Which optional ones make sense to have in most unit files
- Which ones to avoid
- Where to place unit files on the filessytem DONE
- How to name unit files
- Is there something special about the filename like /etc/init.d/httpd => service httpd [ACTION]
- How do we determine which suffix to use with the file?
Filesystem placement
Unit files belong in /lib/systemd/system/. They are architecture independent (hence, **not** %{_lib}) and needed early in the boot process.