Systemd rosetta / cheatsheet

10-02-2013 | Remy van Elst


Table of Contents


The below table has systemd versus init examples. the service used as example is nginx:

Action Debian Init Ubuntu Upstart Red Hat/CentOS Init Systemd
Start service /etc/init.d/nginx start initctl start nginx
/etc/init.d/nginx start
/etc/init.d/nginx start systemctl start nginx.service
Stop service /etc/init.d/nginx stop initctl stop nginx
/etc/init.d/nginx stop
/etc/init.d/nginx stop systemctl stop nginx.service
Restart service /etc/init.d/nginx restart initctl restart nginx
/etc/init.d/nginx restart
/etc/init.d/nginx restart systemctl restart nginx.service
Enable service at boot / startup update-rc.d nginx defaults edit /etc/init/nginx.conf, add start on local-filesystems line
update-rc.d nginx defaults
chkconfig nginx on
ntsysv
systemctl enable nginx.service
Disable service at startup / boot update-rc.d nginx remove echo 'manual' > /etc/init/nginx.override
update-rc.d nginx remove
chkconfig nginx off
ntsysv
systemctl disable nginx.service
List all available services ls /etc/init.d/ initctl list chkconfig --list
ntsysv
systemctl list-units -t service --all
Get a service status /etc/init.d/nginx status initctl status nginx /etc/init.d/nginx status systemctl status nginx.service

Tags: arch-linux, boot, centos, chkconfig, debian, init, redhat, systemd, sysvinit, ubuntu, upstart,