Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

busybox: add logger for runit #82

Open
git-bruh opened this issue Aug 26, 2022 · 3 comments
Open

busybox: add logger for runit #82

git-bruh opened this issue Aug 26, 2022 · 3 comments
Labels

Comments

@git-bruh
Copy link
Member

git-bruh commented Aug 26, 2022

Currently all runit services just spam the tty on boot, and logs aren't stored anywhere. I use the following script to enable logging on my server:

#!/usr/bin/env sh

LOG_BASE="${1:-/var/log/sv}"

# /etc/sv/$sv_name/log
sv_name="$(basename "$(realpath "$PWD/..")")"
logdir="$LOG_BASE/$sv_name"

mkdir -p "$logdir"
exec svlogd -tt "$logdir"

Enabled per-package with another script:

#!/usr/bin/env sh

set -eu

SV="$1"

SVBASE="/etc/sv"
RUNBASE="/run/runit"
LOGDIR="$SVBASE/$SV/log"

[ ! "$SV" ] && exit 1
[ -d "$SVBASE/$SV" ] || exit 1

mkdir -p "$LOGDIR"
ln -sf "$SVBASE/logger" "$LOGDIR/run"
ln -sf "$RUNBASE/supervise.$SV-logger" "$LOGDIR/supervise"

Should we include something like this in the default busybox package or is it better suited for community?

ping @illiliti @ioraff

@ioraff
Copy link
Member

ioraff commented Aug 27, 2022

I think something like this should be included in the busybox package

@illiliti
Copy link
Member

It's good idea and I agree with ioraff. However, we need to sort out realpath usage first.

@git-bruh
Copy link
Member Author

@kiss-community kiss-community locked and limited conversation to collaborators Sep 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants