diff options
Diffstat (limited to 'xmksv')
-rwxr-xr-x | xmksv | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/xmksv b/xmksv index 619ba26..8c0a5d6 100755 --- a/xmksv +++ b/xmksv @@ -1,5 +1,10 @@ #!/bin/sh -e -# xmksv [NEWSVDIR...] - create new runit service templates +# xmksv [-l] [NEWSVDIR...] - create new runit service templates + +if [ "$1" = "-l" ]; then + MKLOG=1 + shift +fi cd ${SVDIR:-/etc/sv} @@ -11,4 +16,15 @@ for SRV; do ln -s /run/runit/supervise."$(printf %s "$SRV" | tr / -)" \ "$SRV/supervise" fi + if [ -n "$MKLOG" ]; then + mkdir "$SRV/log" + cat <<EOF | install -m755 /dev/stdin "$SRV/log/run" +#!/bin/sh +exec vlogger -t $SRV -f daemon +EOF + if [ -w /run/runit ]; then + ln -s /run/runit/supervise."$(printf %s "$SRV/log" | tr / -)" \ + "$SRV/log/supervise" + fi + fi done |