svc
system administrationLinux/Unix
The svc command is one of the most frequently used commands in Linux/Unix-like operating systems. svc Control services monitored by supervise or daemontools
Quick Reference
Command Name:
svc
Category:
system administration
Platform:
Linux/Unix
Basic Usage:
svc [options] [arguments]
Common Use Cases
Syntax
svc [options] service_directories...
Options
Option | Description |
---|---|
-u |
Up: start the service. If the service is already running, this has no effect. |
-d |
Down: stop the service. If the service is already stopped, this has no effect. |
-r |
Restart: send the service a TERM signal, and then restart it when it dies. |
-t |
Terminate: send the service a TERM signal. |
-k |
Kill: send the service a KILL signal. |
-p |
Pause: send the service a STOP signal. |
-c |
Continue: send the service a CONT signal. |
-h |
Hangup: send the service a HUP signal. |
-a |
Alarm: send the service an ALRM signal. |
-i |
Interrupt: send the service an INT signal. |
-q |
Quit: send the service a QUIT signal. |
-1 |
User1: send the service a USR1 signal. |
-2 |
User2: send the service a USR2 signal. |
-o |
Once: if the service is not running, start it. Do not restart it if it stops. |
-x |
Exit: Supervise will exit as soon as the service is down. If the service is down, supervise exits immediately. |
Examples
How to Use These Examples
The examples below show common ways to use the svc
command. Try them in your terminal to see the results. You can copy any example by clicking on the code block.
# Basic Examples Basic
svc -u /service/myservice