One change from RHEL/CentOS 6 to the RHEL 7 beta is how services are controlled. The old service and chkconfig commands are replaced with systemctl. These are my quick and dirty notes compiled from the Fedora Project systemd and SysVinit to Systemd Cheatsheet pages.
The old system command’s replacement is very similar, with services having .service appended:
systemctl start|stop|restart|status name.service
systemctl restart httpd.service
Service Boot time Control
To get a list of available services and their boot time status:
systemctl list-unit-files --type=service
To set a service to start (or not) at boot time:
systemctl enable|disable <em>service</em>.service
systemctl enable mariadb.service systemctl enable httpd.service
Run levels are called targets, have been simplified, and have names now. An incomplete list:
- poweroff.target (run level 0)
- rescue.target (single-user mode; run level 1)
- multi-user.target (normal run level 3)
- graphical.target (normal run level 5)
To set the default run level:
systemctl set-default multi-user.target
To change the run level:
systemctl isolate name.target
For example, to enter single user mode:
systemctl isolate rescue.target
And the appropriate services will be stopped and started.
- Updated setting the default run level per CertDepot’s suggestion. Added the “Additional Reading” section.