OpenRC to systemd Cheatsheet

From Gentoo Wiki
(Redirected from OpenRC to Systemd Cheatsheet)
Jump to: navigation, search

This article is for users that have recently converted from OpenRC to systemd. It contains a list of commands commonly used in OpenRC and its equivalent systemd command.

The following table is not an exhaustive list and is not intended to replace reading man pages.
Command OpenRC systemd Comments
Start a service /etc/init.d/<service> start or rc-service <service> start systemctl start <service>
Stop a service /etc/init.d/<service> stop or rc-service <service> stop systemctl stop <service>
Restart a service /etc/init.d/<service> restart or rc-service <service> restart systemctl restart <service>
Get service status /etc/init.d/<service> status or rc-service <service> status systemctl status <service>
Show known startup scripts rc-status or rc-update show systemctl list-units Shows scripts that exist in runlevels
Show all startup scripts ls /etc/init.d/ or rc-update -v show systemctl list-unit-files --type=service Shows all installed scripts
Enable service at startup rc-update add <service> <runlevel> systemctl enable <service>
Disable service at startup rc-update del <service> <runlevel> systemctl disable <service>

The following table is a list of useful systemd commands that have no OpenRC equivalent:

Command Syntax Comments
Disable automatically generated service systemctl mask <service> Disables dynamically generated services in systemd, which unit files are generated on demand (usually storage triggered services).
Kill all processes related to service systemctl kill <service>
Show logs events that happened today, most recent events first journalctl -r --since=today
Show log events for a specific service journalctl _SYSTEMD_UNIT=<service>.service