s6-rc: the s6-rc-oneshot-run program
Keywords: s6-rc dry run s6-rc-oneshot-run command oneshot runner service manager

s6-rc
Software
skarnet.org

# The s6-rc-oneshot-run internal program

s6-rc-oneshot-run executes a oneshot service's `up` or `down` script taken from the current live compiled database.

s6-rc-oneshot-run is not meant to be used directly; it is used in internal scripts created by s6-rc-compile, which are invoked during an s6-rc execution.

## Interface

         s6-rc-oneshot-run [ -l live ] [ -b ] up|down n

- s6-rc-oneshot-run executes into the `up` or `down` script of the nth oneshot service defined in the current compiled service database (i.e. the compiled linked from the live directory).
- `up` or `down` are run with the `RC_NAME` environment variable set to the name of the service.

## Options

- `-l live` : use the live directory in live. Default is `/run/s6-rc`, or what was given to the `--livedir` configure option at compile time.
- `-b` : blocking lock. If the service database is currently being used by another program, s6-rc-oneshot-run will wait until that other program has released its lock on the database, then proceed. By default, s6-rc-oneshot-run fails with an error message if the database is currently in use.

## Exit codes

- 3: invalid service number
- 4: invalid service database
- 100: wrong usage
- 111: system call failed
- 126: cannot exec script
- 127: cannot exec script: executable not found
- other exit codes: returned from the executed `up` or `down` script