DOKK / manpages / debian 10 / runit / invoke-run.8.en
INVOKE-RUN(8) GNU/Linux System Adminstrator's manual INVOKE-RUN(8)

invoke-run - runscript interpreter

/usr/bin/env /lib/run/invoke-run

The runit supervision system uses scripts, called runscripts to start services. By convention, runscript for a service foo is located at /etc/sv/foo/run

Debhelper addon dh_runit installs runscript according this convention.

Runscript can be any executable file. Runscript can use invoke-run interpreter only if it is installed according convention,

To use invoke-run interpreter, runscript /etc/sv/foo/run for service foo must begin with following line:

#!/usr/bin/env /lib/runit/invoke-run
    

Shell /bin/sh will interpret rest of runscript, with some additional environment set according following rules:

If file /etc/default/foo exists, it is interpreted with /bin/sh and all variable assignment are accessible to runscript.
If directory /etc/sv/foo/conf exists, variables are set according to rules, documented in envdir section of chpst(8) manual.

If both /etc/default/foo file and /etc/sv/foo/conf directory define some variable, value from directory takes precedence.

runsvdir(8), dh_runit(1), chpst(8)

January 21, 2019