SystemD survival guide
This is a short guide I've wrote to start working with systemd after its 'stampede' entrance in Linux distrubitions.
Basic service management
Note that services are now kind of units (the default unit type). There are also socket, device, and other types of unit.
For simplicity of understanding I usually will be talking about service while really may be any kind of unit
Service manage
The usual service
command should still work as usual (I recommend to keep it using as portable tool, in hope that some time in future distributions rethink their choice):
service <service> start service <service> stop service <service> reload service <service> restart service <service> status
For reference, the systemd command (super-command-tool-manager-of-all) to achieve the same (which is really called when you type any of the above commands):
systemctl start <service> systemctl stop <service> systemctl reload <service> systemctl restart <service> systemctl status <service>
Service init configuration
In order to enable disable automatic or not-so-automatic startup of services:
systemctl disable <service> systemctl enable <service> systemctl mask <service> systemctl unmask <service>
Mask/Unmask totally disable/enable the service no only at boot as on call too.
Listing the services
systemctl systemctl list-unit-files systemctl list-dependencies
Init mode
Well, runlevels had gone, now we have 'targets' which really are the same with another name. There are symbolic links from runlevel to to the equivalent target to ease their use.
Really, a target is a grouping of units which must be started to achieve that
Set default runlevel
systemctl enable multi-user.target --force
Change runlevel
systemctl isolate <target>
Runlevel services
Dealing with new (non-wanted) features
These are called specials. Because systemd not only replaced init, it also supply some other non-init features which may interact/interfer with your normal unix understanding. This is a list which I'm now currently learning how to deal with:
- cron
- dhcp
- inet superserver (inetd, xinetd …)
- system logging
- automount
- resolve (both NSS and DNS)
- login
- sysctl?
Advanced
Writing units for services
Configuration
Seems /etc/systemd/system.conf
configure the whole systemd init, while the rest of files under the directory configure services provided by systemd.