Home » Linux Service

Linux service

The service command starts, stop and restart a daemon or services by calling the script. Usually all scripts are stored in /etc/init.d directory.

It runs a script in as predictable environment as possible.

Syntax:

Here, command can be anyone from start, stop, restart and status.


stop command

To stop a service use the following syntax,

Syntax:


start command

To start a service use the following syntax,

Syntax:


restart command

To restart a service use the following syntax,

Syntax:


status command

To get current status of a service use the following syntax,

Syntax:

You may also like