systemctl stop service | Stop a running service |
systemctl start service | Start a service |
systemctl restart service | Restart a running service |
systemctl reload service | Reload all config files in service |
systemctl status service | See if service is running/enabled |
systemctl enable service | Enable a service to start on boot |
systemctl disable service | Disable service (won't start at boot) |
systemctl show service | Show properties of a service (or other unit) |
systemctl -H host status network | Run any systemctl command remotely |
Sysvinit Command | Systemd Command | Notes |
service SERVICE_NAME start | systemctl start SERVICE_NAME (Example: systemctl start cron.service ) | Used to start a service (not reboot persistent) |
service SERVICE_NAME stop | systemctl stop SERVICE_NAME | Used to stop a service (not reboot persistent) |
service SERVICE_NAME restart | systemctl restart SERVICE_NAME | Used to stop and then start a service |
service SERVICE_NAME reload | systemctl reload SERVICE_NAME | When supported, reloads the config file without interrupting pending operations |
service SERVICE_NAME condrestart | systemctl condrestart SERVICE_NAME | Restarts if the service is already running |
service SERVICE_NAME status | systemctl status SERVICE_NAME | Tells whether a service is currently running |
ls /etc/rc.d/init.d/ | systemctl or systemctl list-unit-files --type=service or
ls /lib/systemd/system/*.service /etc/systemd/system/*.service | Used to list the services that can be started or stopped Used to list all the services and other units |
chkconfig SERVICE_NAME on | systemctl enable SERVICE_NAME | Turn the service on, for start at next boot, or other trigger |
chkconfig SERVICE_NAME off | systemctl disable SERVICE_NAME | Turn the service off for the next reboot, or any other trigger |
chkconfig SERVICE_NAME | systemctl is-enabled SERVICE_NAME | Used to check whether a service is configured to start or not in the current environment |
chkconfig --list | systemctl list-unit-files --type=service or
ls /etc/systemd/system/*.wants/ | Print a table of services that lists which runlevels each is configured on or off |
chkconfig --list | grep 5:on | systemctl list-dependencies graphical.target | Print a table of services that will be started when booting into graphical mode |
chkconfig SERVICE_NAME --list | ls /etc/systemd/system/*.wants/SERVICE_NAME.service | Used to list what levels this service is configured on or off |
chkconfig SERVICE_NAME --add | systemctl daemon-reload | Used when you create a new service file or modify any configuration |
Sysvinit Runlevel | Systemd Target | Notes |
0 | runlevel0.target, poweroff.target | Halt the system |
1, s, single | runlevel1.target, rescue.target | Single user mode |
2, 4 | runlevel2.target, runlevel4.target, multi-user.target | User-defined/Site-specific runlevels. By default, identical to 3 |
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 | runlevel6.target, reboot.target | Reboot |
emergency | emergency.target | Emergency shell |