There are no notfications.

Service managers (Linux)

Service managers (Linux)
Author: Stefán Örvar Sigmundsson
Initial publication:
Last updated:
Written in: English (United Kingdom)

A service manager is a service that manages all other services on an operating system from startup to shutdown. A service is a process running in the background that is not under direct control of an interactive user. Services are responsible for responding to network activity, configuring hardware and running scheduled tasks amongst many other things. In Unix-like environments, services are often referred to as daemons and their names traditionally end with the letter d.

Each service must be accompanied by a configuration file that specifies where the service is located and what, if any, instructions should be executed before and after the service is run. The type and location of the configuration files depend on the service manager.

init

init (short for initialisation) is a service manager that was originally developed on Unix but was later adopted for Linux. It served as the predominant service manager on Linux until 2015 when systemd was adopted by predominant Linux distributions such as Debian and Ubuntu.

init configuration files for services are shell scripts located in the /etc/init.d/ directory. The service utility is used to control services from the terminal.

Example 1: To start a service the start command is used:

root@computer:~# service [service] start

Example 2: To stop a service the stop command is used:

root@computer:~# service [service] stop

Upstart

Upstart is a service manager that was developed by Canonical for their Linux distribution. It was released in 2006 and served as the default service manager for Ubuntu until systemd was adopted in 2015.

Upstart configuration files for services are referred to as jobs and are located in the /etc/init/ directory. The initctl utility is used to control services from the terminal.

Example 1: To start a service the start command is used:

root@computer:~# initctl start [service]

Example 2: To stop a service the stop command is used:

root@computer:~# initctl stop [service]

The starting and stopping of services from the terminal can additionally be achieved with the start and stop aliases of the initctl utility.

Example 1: To start a service the start alias is used:

root@computer:~# start [service]

Example 2: To stop a service the stop alias is used:

root@computer:~# stop [service]

In order to maintain backward compatibility with the init service manager the service utility was modified to work with Upstart jobs as well as init scripts. If an Upstart job exists for a service in the /etc/init/ directory then it is run, otherwise the init scripts in the /etc/init.d/ directory is run.

systemd

systemd is not just a service manager but a system manager developed by Red Hat employees on Fedora. As a system manager, systemd can additionally handle event logging, session management, network configuration, hardware management and much more. It has replaced both init and Upstart on predominant Linux distributions such as Debian and Ubuntu.

systemd configuration files are referred to as units and are located in the /etc/systemd/system/ directory. The systemctl utility is used to control services from the terminal.

Example 1: To start a service the start command is used:

root@computer:~# systemctl start [service]

Example 2: To stop a service the stop command is used:

root@computer:~# systemctl stop [service]

Comparison

init systemd Upstart
Original distribution: Unix Fedora (2011) Ubuntu (2006)
Configuration location: /etc/init.d/ /etc/init/ /etc/systemd/system/
Configuration type: shell scripts units jobs
Control utility: service systemctl initctl

External links