systemd is a software suite that provides an array of system components for Linux operating systems.
Its main aim is to unify service configuration and behavior across Linux distributions; systemd’s primary component is a “system and service manager”—an init system used to bootstrap user space and manage user processes. It also provides replacements for various daemons and utilities, including device management, login management, network connection management, and event logging. The name systemd adheres to the Unix convention of naming daemons by appending the letter d. It also plays on the term “System D”, which refers to a person’s ability to adapt quickly and improvise to solve problems.
systemd services reside in
To create a new service create a file
and then add the following to define the service.
In linux.rhel.7 this is the replacement for init.d.
[Unit] Description=Description After=network.target [Service] Type=simple User=<user> ExecStart=<script location> Restart=on-failure [Install] WantedBy=multi-user.target
Afterspecifes what service to bring up this service after
ExecStartspecifies the script to run to start the service
WantedByspecifies the level to run it at in this case multi-user.target means the service will start up when booting into multi-user mode.
Go to /etc/systemd/system and execute below enable command
systemctl enable <service-name>.service