Legacy INIT vs systemd

From The Linux Source
Jump to: navigation, search

Preamble
SysVinit (before Enterprise 7) was the standard init scripts & init structure everyone has gotten familiar with, using service & chkconfig commands, with Enterprise 7 we have systemd which no longer uses the traditional init scripts or SysVinit init script location, and uses the systemctl command

Init Scripts Locations

(existing ones are good examples for creating new ones)
SysVinit:

/etc/init.d/ - the actual init scripts
/etc/rc.d/rc#.d/ - # for the different run levels, having symlinks to the actual init scripts in /etc/init.d/

systemd:

/usr/lib/systemd/system/ - for system/OS related config files (analogous to init scripts)
/etc/systemd/system/ & /etc/systemd/system/*/ - symlinks to the actual init scripts (there are no "run levels" per se, at least not "run level" numbers)
/run/systemd/system/ - temporary runtime generated scripts (overrides system scripts)
/etc/systemd/user/ - user created scripts (overrides runtime scripts)

Quick Reference

(.service is optional, and is assumed)

# systemctl status name[.service]
# systemctl enable name[.service]
# systemctl disable name[.service]
# systemctl start name[.service]
# systemctl stop name[.service]
# systemctl restart name[.service]
# systemctl reload name[.service]
# systemctl is-active name[.service]
# systemctl list-units --type service --all
# systemctl list-units --type target --all
# systemctl get-default
# systemctl set-default graphical.target

systemd Logging