SysVinit to Systemd Cheatsheet

From FedoraProject

(Difference between revisions)
Jump to: navigation, search
(More commands and runlevels section)
 
(add a few items)
Line 6: Line 6:
 
!SystemVinit Command!!Systemd Command!!Notes
 
!SystemVinit Command!!Systemd Command!!Notes
 
|-
 
|-
| ls -al /etc/rc.d/init.d || || Used to list the services that can be started or stopped
+
| ls -al /etc/rc.d/init.d || systemctl --all || Used to list the services that can be started or stopped
 
|-
 
|-
 
| chkconfig httpd --list || || Used to list what levels this service is configured on or off
 
| chkconfig httpd --list || || Used to list what levels this service is configured on or off
Line 14: Line 14:
 
| chkconfig httpd levels 345 off || || Turn the service off for the next reboot
 
| chkconfig httpd levels 345 off || || Turn the service off for the next reboot
 
|-
 
|-
| service httpd start || || Used to start a service (not reboot persistent)
+
| service httpd start || systemctl start httpd.service || Used to start a service (not reboot persistent)
 
|-
 
|-
| service httpd stop || || Used to stop a service (not reboot persistent)
+
| service httpd stop || systemctl stop httpd.service || Used to stop a service (not reboot persistent)
 
|-
 
|-
| service httpd restart || || Used to stop and then start a service
+
| service httpd restart || systemctl restart httpd.service || Used to stop and then start a service
 
|-
 
|-
 
| service httpd graceful || || When supported, does a restart that does not interrupt any pending operations.
 
| service httpd graceful || || When supported, does a restart that does not interrupt any pending operations.

Revision as of 19:39, 9 September 2010

This is a document to help system administrators who need to understand what commands in systemd replace their old workflow in SysVinit.

Commands

SystemVinit Command Systemd Command Notes
ls -al /etc/rc.d/init.d systemctl --all Used to list the services that can be started or stopped
chkconfig httpd --list Used to list what levels this service is configured on or off
chkconfig httpd levels 345 on Turn the service on for the next reboot
chkconfig httpd levels 345 off Turn the service off for the next reboot
service httpd start systemctl start httpd.service Used to start a service (not reboot persistent)
service httpd stop systemctl stop httpd.service Used to stop a service (not reboot persistent)
service httpd restart systemctl restart httpd.service Used to stop and then start a service
service httpd graceful When supported, does a restart that does not interrupt any pending operations.
service httpd reload When supported, reloads the config file without interrupting pending operations.
telinit 3 systemctl isolate runlevel3.target Change to multi-user run level. See also: Runlevels
sed s/^id:.*:initdefault:/id:3:initdefault:/ ln -sf /lib/systemd/systemd/multi-user.target /etc/systemd/system/default.target Set to use multi-user runlevel on next reboot. See also: Runlevels

Runlevels

runlevels are used with telinit and on the kernel command line in SystemVinit. With systemd, the following can be used instead.

SystemVinit Runlevel Systemd Target Notes
0 Halt the system.
1, s, single Single user mode.
2, 4 User/sites may define runlevels with sets of packages for these.
3 runlevel3.target, multi-user.target Multi-user, non-graphical. Users can usually login via multiple consoles or via the network.
5 runlevel5.target, graphical.target Multi-user, graphical. Usually has all the services of runlevel 3 plus a graphical login.
6 Reboot