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:

ActionDebian InitUbuntu UpstartRed Hat/CentOS InitSystemd
Start service/etc/init.d/nginx startinitctl start nginx
/etc/init.d/nginx start
/etc/init.d/nginx startsystemctl start nginx.service
Stop service/etc/init.d/nginx stopinitctl stop nginx
/etc/init.d/nginx stop
/etc/init.d/nginx stopsystemctl stop nginx.service
Restart service/etc/init.d/nginx restartinitctl restart nginx
/etc/init.d/nginx restart
/etc/init.d/nginx restartsystemctl restart nginx.service
Enable service at boot / startupupdate-rc.d nginx defaultsedit /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 / bootupdate-rc.d nginx removeecho 'manual' > /etc/init/nginx.override
update-rc.d nginx remove
chkconfig nginx off
ntsysv
systemctl disable nginx.service
List all available servicesls /etc/init.d/initctl listchkconfig --list
ntsysv
systemctl list-units -t service --all
Get a service status/etc/init.d/nginx statusinitctl status nginx/etc/init.d/nginx statussystemctl status nginx.service

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