Systemd

From Rivalug Wiki

Jump to: navigation, search
old vs new table
redhat family linux traditional
RHEL/Centos 3-6
Fedora 1-14
linux with systemd
Fedora 15-16
Solaris 10 Service Management Facility BSD
Unix Sys V
list all running services chkconfig --list systemctl (or)
systemctl --full
svcs -a
Activates a service immediately service foo start systemctl start foo.service svcadm [-v] enable -t <FMRI> /etc/rc.d/foo start
Deactivates a service immediately service foo stop systemctl stop foo.service svcadm [-v] disable -t <FMRI> /etc/rc.d/foo stop
Restarts a service service foo restart systemctl restart foo.service svcadm [-v] restart <FMRI> (or)
svcadm [-v] refresh <FMRI>
refresh is the equivalent of the old "kill -HUP" and is required to re-read any configuration changes
/etc/rc.d/foo restart
Enables a service to be started on bootup chkconfig foo on systemctl enable foo.service svcadm [-v] enable <FMRI> edit /etc/rc.conf
Disables a service to not start during bootup chkconfig foo off systemctl disable foo.service svcadm [-v] disable <FMRI> /etc/rc.conf
Shows status of a service including whether it is running or not chkconfig foo status systemctl status foo.service 15
Check whether a service is already enabled or not chkconfig --list | grep foo | grep :on systemctl is-enabled foo.service; echo $? 15
Switch to runlevel 3 init 3 systemctl isolate multi-user.target (or)
systemctl isolate runlevel3.target
15
Switch to runlevel 5 init 5 systemctl isolate graphical.target (or)
systemctl isolate runlevel5.target
15
Switch to runlevel 3 by default edit /etc/inittab rm /etc/systemd/system/default.target
ln -sf /lib/systemd/system/multi-user.target /etc/systemd/system/default.target
15
Switch to runlevel 5 by default edit /etc/inittab rm /etc/systemd/system/default.target
ln -sf /lib/systemd/system/graphical.target /etc/systemd/system/default.target
15
Reboot computer reboot (or)
init 6
reboot (need to test) shutdown -y -g0 -i6
Power off computer poweroff (or)
init 0
poweroff shutdown -y -g0 -i5
Halt the operating system
( but don't power off the computer )
halt halt (need to test) shutdown -y -g0 -i0



References:

Personal tools