From d5fa2e99de17182e405225d39ce96c0b1b92a11b Mon Sep 17 00:00:00 2001 From: crater2150 Date: Mon, 21 Aug 2023 11:34:22 +0200 Subject: [PATCH] Make logging base dir configurable --- README.md | 5 ++--- log | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 8efc6a9..e3ef11b 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Various runit service files for per-user services. May need to be modified to wo Helper scripts: - `log`: symlink as the `run` script in your service's log directory to enable - logging to `~/.local/log/` + logging to `$SVLOGDIR`. If unset, defaults to `~/.local/log/` - `utils/setup-supervise.zsh`: run to create symlinks for `supervise` directories, so they are created in $XDG_RUNTIME_DIR - `utils/new-service`: create a new service, executing the given command line. @@ -17,6 +17,5 @@ Helper scripts: ```sh utils/new-service -l my-daemon --foreground -a -b -c ``` -- `utils/svlogs`: like svlogtail for user services. Uses $SVLOGDIRS or - `~/.local/log/` as base dir. ZSH completion file available in +- `utils/svlogs`: like svlogtail for user services. ZSH completion file available in `utils/completions` diff --git a/log b/log index 972e98e..2cfb6ac 100755 --- a/log +++ b/log @@ -1,5 +1,5 @@ #!/bin/zsh SERVICE=${0:a:h:h:t} -LOGDIR=$HOME/.local/log/$SERVICE +LOGDIR=${SVLOGDIR:-$HOME/.local/log}/$SERVICE mkdir -p $LOGDIR exec svlogd -ttt $LOGDIR