2 # the -S1 tells execline to substitute 1 positional parameter
3 # which for this file is: the name of the service directory
6 # a sane example of handling the arguments would be nice
8 # populate some variables
10 define INSTANCE_NAME jane
11 backtick HOME { homeof ${RUN_USER} }
12 importas -n -u HOME HOME
14 # redirect STDERR to STDIN so it can be caught by a logging service
17 # switch to a different user for running this
18 s6-setuidgid ${RUN_USER}
23 pipeline { echo "system_powerdown\n" }
24 s6-ipcclient ${HOME}/${INSTANCE_NAME}-monitor.socket
29 # the command to start and supervise
30 imaginary_service -l 127.0.0.1 -p 31337 ${HOME}/run/listener_${INSTANCE_NAME}/${INSTANCE_NAME}.conf