Systemd (en)
systemd is the init system used on the Dreambox since OE 2.2. The system starts, monitors and stops services. The activities of the services are also logged by this system. It can also be used to configure the system and to mount devices. Compared to the older SysVinit system, the systemd is also faster because it can start services simultaneously. Systemd is backwards compatible for SysVinit scripts, which are still used on the Dreambox.
Systemctl
Systemctl is the main program of systemd. The command starts, stops, enables, disables services and can display status information. General configuration files can be found in /etc/systemd. Config files which are created manually or belong to services can be found in the directory /etc/systemd/system, or /lib/systemd/system.
Important parameters for systemctl which are used to manage services are: start, stop, restart, enable, or disable. In this article the management of services is explained with some examples.
The following examples can be used with enigma2 as $service_name.
|
Show information about systemctl
systemctl --helpStart service
systemctl start $service_nameStop service
systemctl stop $service_nameDisable service
The following command disables a service. After a restart, the service will no longer be startet.
systemctl disable $service_nameEnable service
systemctl enable $service_nameShow service status
systemctl status $service_nameJournalctl
An additional important command is journalctl. It can be used to read, filter, export or check log entries of systemd. The output in the terminal can be stopped with Ctrl+c.
Show options for journalctl
journalctl --helpShow system journal
The command will show all information concerning system. With PgUP and PgDn the journal can be browsed.
journalctlIf the actual information should be displayed immediately, use the option -f for follow.
journalctl -fShow journal for a service
The command shows the information for a specific service.
journalctl -f -u $service_nameWrite journal in a file
The command saves the information in a file.
journalctl -f -u $service_name >> /tmp/journal.logOther interesting commands
Change host name
Changes the name (/etc/hostname) of the Dreambox, important if you use 2 identical Dreambox models.
hostnamectl set-hostname $new_nameSet system time / date
To see the time / date.
timedatectl statusTo set the time / date.
timedatectl set-time "yyyy-MM-dd hh:mm:ss"Show device status
systemctl /dev/$devicename statusReboot Dreambox
systemctl rebootShut down Dreambox
systemctl poweroff