Managing Services in Linux


Managing Services in Linux

Services are programs or processes always running on your server, usually from the time generally booting a server. They provide permanent support for other procedures or external clients and observation requests. Examples of known services are Apache and Postfix.

Init System

The system is the first process that starts outside the kernel; it is a backend service that controls how it generally works. The systemd is used exception except the Centos6 images used by systemd. Some Ubuntu installs may still use upstart.

Systemd

According to the Systemd, services' units are included in a more general description. Units can be used to perform an off-task in the boot and perform many other things. You can use the "SystemTl" command without arguments to get a list of all units. Anyone who is marked "enabled" will always be started in the boot. Each service and current state can be found from the same output.

Upstart

The upstart is only on some Ubuntu releases; systemd is vital. Usually, you use the same systems as Sysvinit. Upstart includes the ability to run some scripts by startup sequence. Use "Update-rc.d" to enable or disabled startup scripts. Command "command" to start or prevent as needed.

Starting and Stopping Services

On systems that use the System-V style init scripts, such as RHEL/CentOS 6:

service start

service stop

On systems using systemd, such as Ubuntu (Server and Desktop) >= 15.04, and RHEL/CentOS >= 7:

systemctl dnsmasq

systemctl dnsmasq

Getting the status of a service

On systems that use the System-V style init scripts, such as RHEL/CentOS 6:

service status

On systems using systemd, such as Ubuntu (Server and Desktop) >= 15.04, and RHEL/CentOS >= 7.0:

systemctl status