mirror of https://dev.ccchb.de/ccchb/ansible.git
31 lines
721 B
Plaintext
31 lines
721 B
Plaintext
|
#!/usr/local/bin/execlineb -P
|
||
|
# {{ ansible_managed }}
|
||
|
|
||
|
s6-envdir ./env
|
||
|
multisubstitute {
|
||
|
importas -i -u NAME NAME
|
||
|
importas -i -u USER USER
|
||
|
importas -i -u GROUP GROUP
|
||
|
importas -i -u MODE MODE
|
||
|
importas -i -u DIR DIR
|
||
|
}
|
||
|
|
||
|
foreground { fdmove -c 1 2 echo "bhyve-${NAME}-log: Starting." }
|
||
|
|
||
|
ifelse -n { install -d -o "${USER}" -g "${GROUP}" -m "${MODE}" "$DIR" } {
|
||
|
foreground { fdmove -c 1 2 echo "bhyve-${NAME}-log: Failed to create logging directory." }
|
||
|
false
|
||
|
}
|
||
|
|
||
|
ifelse -n { fdmove 1 3 echo } {
|
||
|
foreground { fdmove -c 1 2 echo "bhyve-${NAME}-log: Failed to signal readiness." }
|
||
|
false
|
||
|
}
|
||
|
|
||
|
foreground { fdmove -c 1 2 echo "bhyve-${NAME}-log: Ready." }
|
||
|
|
||
|
fdmove -c 2 1
|
||
|
|
||
|
s6-envuidgid $USER
|
||
|
s6-log T $DIR
|