Configuring service unit files for use with systemd
Introduction In an earlier article, we discussed the systemd system startup manager in detail and also ventured into the reasons why it has replaced sysvinit as the default system startup and service manager for many popular Linux distributions including RedHat, Centos, and Ubuntu. Within Centos 7/RHEL 7 we are provided with targets or target units instead of run levels and in a similar manner service units now represent service scripts in systemd. In this article, we will demonstrate how we can create service unit files which are analogous to the init scripts in sysvinit which we already covered in a previous article. An overview of systemctl One of the interesting features of systemd is that run level management and service management are under the control of a unified tool named systemctl. Therefore, systemd does not use the service and chkconfig commands or the init or telinit command to change run levels. To enable or start a service, for example, sshd on boot, we would use the following command. systemctl enable sshd To disable the sshd service on boot, we would use the following command. systemctl start sshd To view the status of the sshd service, we would use the following command. systemctl status sshd The systemctl status command is especially more useful and verbose as compared to it’s predecessor, the service status command because it not only provides...
Read More