What is systemd ?
systemd is a system and service manager for Linux, compatible with SysV and LSB init scripts. systemd provides aggressive parallelization capabilities, uses socket and D-Bus activation for starting services, offers on-demand starting of daemons, keeps track of processes using Linux cgroups, supports snapshotting and restoring of the system state, maintains mount and automount points and implements an elaborate transactional dependency-based service control logic. It can work as a drop-in replacement for sysvinit.
How and why are we using systemd in IPFire 3.x
Systemd has been implemented into IPFire 3.x as an replacement of the old SysVinit system, because it provides a faster startup and a useable system if one or more services fails to startup. It also provides a plattform for central service management to start / stop services or to get their status information. We are using systemd without any support for SysV and LSB scripts, because we want a native systemd and native units - so we have disabled any support for that.
How to use systemd
In IPFire 3.x systemd can only be used from shell, because we doesn't provide a X-Server or GTK framework to use the graphical applications.
List all services
To get a list off all services type the following command on the shell:
systemctl
You will get a list of all services and it's status - if they are running or not, or maybe the fail on startup and so on....
Start / Stop a service
To start or stop a service you have to know the name of it's "service" file. The are stored in /lib/systemd/system/
.
To start a service type the following command on the shell:
systemctl start filename.service
To stop it use:
systemctl stop filename.service
Status of a service
To get the status information or error message from a service just type:
systemctl status filename.service
Enable / disable a service on startup
To enable or disable a service just type:
systemctl enable filename.service
To disable it on startup type:
systemctl disable filename.service
Enable serial console
To enable the serial console just add "console=ttyS0" to the kernel command line at the grub entry.
Systemd will automaticall start a getty for this serial port. Check this with
systemctl status serial-getty@ttyS0.service
Links
More information about systemd, how to deal with it and how to write own service files or units can be found at the following links:
- http://0pointer.de/blog/projects/systemd-for-admins-1.html
- http://0pointer.de/blog/projects/systemd-for-admins-2.html
- http://0pointer.de/blog/projects/systemd-for-admins-3.html
- http://0pointer.de/blog/projects/systemd-for-admins-4.html
- http://0pointer.de/blog/projects/systemd-for-admins-5.html
- http://0pointer.de/blog/projects/systemd-for-admins-6.html