From bd44e7cec69e7a2eef88c787211e4baa906954e8 Mon Sep 17 00:00:00 2001 From: classabbyamp Date: Sun, 5 Feb 2023 13:02:46 -0500 Subject: xmksv: add ability to create log services --- README | 5 +++-- xmksv | 18 +++++++++++++++++- xtools.1 | 8 ++++++-- 3 files changed, 26 insertions(+), 5 deletions(-) diff --git a/README b/README index 0d7c826..ae78e4a 100644 --- a/README +++ b/README @@ -91,8 +91,9 @@ COMMANDS xmandoc manpage – read manpage of possibly not installed package - xmksv [newsvdir] - – create new runit service templates + xmksv [-l] [newsvdir ...] + – create new runit service templates. Also creates log service if -l + is passed. xmypkgs [email] – list all pkgs maintained by you 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 <