rc-service - Man Page
locate and run an OpenRC service with the given arguments
Examples (TL;DR)
Show a service's status:
rc-service service_name status
Start a service:
sudo rc-service service_name start
Stop a service:
sudo rc-service service_name stop
Restart a service:
sudo rc-service service_name restart
Simulate running a service's custom command:
sudo rc-service --dry-run service_name command_name
Actually run a service's custom command:
sudo rc-service service_name command_name
Resolve the location of a service definition on disk:
sudo rc-service --resolve service_name
Synopsis
rc-service | [-c , --ifcrashed ] service cmd [...] |
rc-service | -d , --debug service cmd [...] |
rc-service | -D , --nodeps service cmd [...] |
rc-service | [-i , --ifexists ] service cmd [...] |
rc-service | [-I , --ifinactive ] service cmd [...] |
rc-service | [-N , --ifnotstarted ] service cmd [...] |
rc-service | [-s , --ifstarted ] service cmd [...] |
rc-service | [-S , --ifstopped ] service cmd [...] |
rc-service | -e , --exists service |
rc-service | -Z , --dry-run service cmd [...] |
rc-service | -l , --list |
rc-service | -r , --resolve service |
Description
Service scripts could be in different places on different systems. rc-service locates the specified service and runs it with the given arguments. If -i
, --ifexists
is given then rc-service returns 0 even if the service does not exist. If -I
, --ifinactive
or -N
, --ifnotstarted
is given then rc-service returns 0 if the service exists but is in the wrong state.
If given the -l
, --list
argument then rc-service will list all available services.
-e
, --exists
return 0 if it can find service, otherwise -1. -r
, --resolve
does the same and also prints the full path of the service to stdout.
-d
, --debug
sets -x when running the service script(s).
-D
, --nodeps
ignores dependencies when running the service.
-Z
, --dry-run
displays commands rather than executing them.
See Also
Authors
Roy Marples <roy@marples.name>