initctl Command Examples in Linux

The initctl command sends commands to the Upstart init daemon. Use it to monitor jobs or events, call jobs directly, or send custom events to the daemon.

Syntax:

# initctl [options] command

Options

Option Description
–show-ids Show unique process id (pid) as well as the job id.
–by-id Parameter passed to command is a job id.
–no-wait When using start, stop, or emit, exit immediately instead of waiting for the request to finish.
–quiet Only show errors when running the given command.

initctl Command Examples

1. To start the job/service:

# initctl start JOB

2. To stop a job/service:

# initctl stop JOB

3. To restart a job/service:

# initctl restart JOB

4. To reload a job/service:

# initctl reload JOB

5. To get the status of a service/job:

# initctl status JOB

6. To list all the initctl controlled services/jobs:

# initctl list

7. To reload the configuration file:

# initctl reload-configuration JOB

8. To get the version of the init daemon:

# initctl version

9. To set the log priority:

# initctl debug
# initctl info
# initctl message
# initctl warn
# initctl error
# initctl fatal
Related Post