Permalink
Browse files

s6-init: Allow USE flag configuration of s6-log args

Useful for managing system specific limits on diskspace usage for log files.

Signed-off-by: Esben Haabendal <esben@haabendal.dk>
  • Loading branch information...
esben committed Aug 24, 2018
1 parent 26cedf6 commit 5ef6d85767d48711364df295ae6a55f1e156c340
@@ -196,6 +196,20 @@ do_install() {
done
}
# Allow USE flag configuration of s6-log arguments
RECIPE_FLAGS += "devd_log_args klogd_log_args svscan_log_args syslogd_log_args"
DEFAULT_USE_devd_log_args = "s1000000 n20"
DEFAULT_USE_klogd_log_args = "s1000000 n20"
DEFAULT_USE_svscan_log_args = " "
DEFAULT_USE_syslogd_log_args = "s1000000 n20"
do_configure_s6_log() {
sed -i -e "s|__args__|${USE_devd_log_args}|" ${SRCDIR}/devd-log.run
sed -i -e "s|__args__|${USE_klogd_log_args}|" ${SRCDIR}/klogd-log.run
sed -i -e "s|__args__|${USE_svscan_log_args}|" ${SRCDIR}/svscan-log.run
sed -i -e "s|__args__|${USE_syslogd_log_args}|" ${SRCDIR}/syslogd-log.run
}
do_configure[postfuncs] += "do_configure_s6_log"
SRC_URI += "file://devtable.txt"
inherit makedevs
MAKEDEVS_FILES = "${SRCDIR}/devtable.txt"
@@ -4,4 +4,4 @@ if { if -t -n { test -e /var/log/devd }
install -d -m 755 -o nobody -g nogroup /var/log/devd }
s6-setuidgid nobody
exec -c
s6-log t s1000000 n20 /var/log/devd
s6-log __args__ t /var/log/devd
@@ -4,4 +4,4 @@ if { if -t -n { test -e /var/log/kernel }
install -d -m 755 -o nobody -g nogroup /var/log/kernel }
s6-setuidgid nobody
exec -c
s6-log t s1000000 n20 -^kern.debug /var/log/kernel
s6-log __args__ t -^kern.debug /var/log/kernel
@@ -6,4 +6,4 @@ redirfd -w 2 /dev/console
redirfd -w 1 /dev/null
redirfd -rnb 0 fifo
s6-applyuidgid -u 65534 -g 65534 --
s6-log -bp -- t /var/log/svscan
s6-log -bp -- __args__ t /var/log/svscan
@@ -4,4 +4,4 @@ if { if -t -n { test -e /var/log/syslog }
install -d -m 755 -o nobody -g nogroup /var/log/syslog }
s6-setuidgid nobody
exec -c
s6-log t s1000000 n20 /var/log/syslog
s6-log __args__ t /var/log/syslog

0 comments on commit 5ef6d85

Please sign in to comment.