kiss-community / repo

KISS Linux - Unofficial Repositories, mirror of https://codeberg.org/kiss-community/repo
https://kisslinux.org
MIT License
41 stars 17 forks source link

busybox: add logger for runit #82

Open git-bruh opened 2 years ago

git-bruh commented 2 years ago

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 commented 2 years ago

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

illiliti commented 2 years ago

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

git-bruh commented 2 years ago

https://codeberg.org/kiss-community/repo/issues/82