Skip to content

Systemd

Quick reference for managing services and the system state on Engicam boards running systemd-based Linux distributions.


Service Management

Command Description
systemctl start <service> Start a service
systemctl stop <service> Stop a running service
systemctl restart <service> Restart a service
systemctl reload <service> Reload configuration without restarting
systemctl enable <service> Enable service to start on boot
systemctl disable <service> Disable service from starting on boot
systemctl status <service> Show current status and recent logs
systemctl show <service> Show all properties of a service

System Information

Command Description
systemctl list-units Show all loaded units and their state
systemctl list-unit-files Show unit files and enabled/disabled state
systemctl list-dependencies <unit> Show unit dependency tree
systemctl list-jobs Show active systemd jobs
systemctl get-default Show default boot target

System State

Command Description
systemctl reboot Reboot the system
systemctl poweroff Power off the system
systemctl emergency Drop to emergency shell
systemctl default Return to default target

Logs with journald

Command Description
journalctl Show all collected log messages
journalctl -u <service> Show logs for a specific service
journalctl -f Follow logs in real time
journalctl -k Show kernel messages only
journalctl --since "10 min ago" Show recent entries

Writing a Custom Service

Create a unit file at /etc/systemd/system/<name>.service:

[Unit]
Description=My Custom Service
After=network.target

[Service]
Type=simple
ExecStart=/usr/bin/my-app
Restart=on-failure
RestartSec=5

[Install]
WantedBy=multi-user.target

Then enable and start it:

systemctl daemon-reload
systemctl enable my-custom.service
systemctl start my-custom.service