Permalink
Browse files

Merge pull request #586 from esben/s6-log-args

Allow USE flag configuration of s6-log arguments
  • Loading branch information...
Villemoes committed Aug 30, 2018
2 parents 5605a8b + 417df47 commit 49cba5a28dfb0f316f7aa957586628b3e1eb5959
@@ -109,3 +109,10 @@ SRC_URI += "file://dhcpd.run file://dhcpd-log.run file://dhcpd-log.notification-
DEFAULT_USE_dhcpd_s6rc_dependencies = "dhcpd-log net"
RECIPE_FLAGS += "dhcpd_s6rc_dependencies"
FILES_${PN}-server += "${s6rcsrcdir}"
RECIPE_FLAGS += "dhcpd_log_args"
DEFAULT_USE_dhcpd_log_args = "s131072"
do_configure_s6_log() {
sed -i -e "s|__args__|${USE_dhcpd_log_args}|" ${SRCDIR}/dhcpd-log.run
}
do_configure[postfuncs] += "do_configure_s6_log"
@@ -8,4 +8,4 @@ s6-setuidgid nobody
if { fdmove 1 6 s6-echo ok }
fdclose 6
exec -c
s6-log -b -- s131072 t /var/log/dhcpd
s6-log -b -- __args__ t /var/log/dhcpd
@@ -75,6 +75,13 @@ S6RC_LONGRUN_SERVICES += "network-log"
SRC_URI += "file://network-log.run file://network-log.notification-fd"
RECIPE_FLAGS += "network_log_s6rc_dependencies"
RECIPE_FLAGS += "network_log_args"
DEFAULT_USE_network_log_args = "s131072"
do_configure_s6_log() {
sed -i -e "s|__args__|${USE_network_log_args}|" ${SRCDIR}/network-log.run
}
do_configure[postfuncs] += "do_configure_s6_log"
# Service for doing "ifup -a" and "ifdown -a"
S6RC_ONESHOT_SERVICES += "net-auto"
SRC_URI_S6RC += "file://net-auto.up file://net-auto.down"
@@ -8,4 +8,4 @@ s6-setuidgid nobody
if { fdmove 1 6 s6-echo ok }
fdclose 6
exec -c
s6-log -b -- s131072 t /var/log/network
s6-log -b -- __args__ t /var/log/network
@@ -8,4 +8,4 @@ s6-setuidgid nobody
if { fdmove 1 6 s6-echo ok }
fdclose 6
exec -c
s6-log -b -- s131072 t /var/log/ntpd
s6-log -b -- __args__ t /var/log/ntpd
@@ -114,3 +114,10 @@ SRC_URI += "file://ntpd.run file://ntpd-log.run file://ntpd-log.notification-fd"
RECIPE_FLAGS += "ntpd_s6rc_dependencies"
DEFAULT_USE_ntpd_s6rc_dependencies = "ntpd-log net"
FILES_${PN}-ntpd += "${s6rcsrcdir}"
RECIPE_FLAGS += "ntpd_log_args"
DEFAULT_USE_ntpd_log_args = "s131072"
do_configure_s6_log() {
sed -i -e "s|__args__|${USE_ntpd_log_args}|" ${SRCDIR}/ntpd-log.run
}
do_configure[postfuncs] += "do_configure_s6_log"
@@ -9,4 +9,4 @@ if { fdmove 1 6 s6-echo ok }
fdclose 6
pipeline { tr -d "\r" }
exec -c
s6-log -b -- s131072 t /var/log/openssh
s6-log -b -- __args__ t /var/log/openssh
@@ -146,6 +146,15 @@ do_install_HOST_KEYTYPES = ""
do_install_HOST_KEYTYPES:USE_s6rc = "do_install_host_keytypes"
do_install[postfuncs] += "${do_install_HOST_KEYTYPES}"
RECIPE_FLAGS += "openssh_log_args"
DEFAULT_USE_openssh_log_args = "s131072"
do_configure_s6_log() {
sed -i \
-e "s|__args__|${USE_openssh_log_args}|" \
${SRCDIR}/openssh-log.run
}
do_configure[postfuncs] += "do_configure_s6_log"
RDEPENDS_${PN}-sshd:>USE_s6rc = " util/tr"
PACKAGEQA_TARGET_BINDIRS += "${target_libexecdir}"
@@ -8,4 +8,4 @@ s6-setuidgid nobody
if { fdmove 1 6 s6-echo ok }
fdclose 6
exec -c
s6-log -b -- s131072 t /var/log/openvpn
s6-log -b -- __args__ t /var/log/openvpn
@@ -54,3 +54,10 @@ do_install[postfuncs] += "do_install_s6"
PACKAGES =+ "${PN}-s6"
FILES_${PN}-s6 = "${sysconfdir}/rc.hooks ${s6rcsrcdir}"
RDEPENDS_${PN}:>USE_s6rc += " ${PN}-s6"
RECIPE_FLAGS += "openvpn_log_args"
DEFAULT_USE_openvpn_log_args = "s131072"
do_configure_s6_log() {
sed -i -e "s|__args__|${USE_openvpn_log_args}|" ${SRCDIR}/openvpn-log.run
}
do_configure[postfuncs] += "do_configure_s6_log"
@@ -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
@@ -8,4 +8,4 @@ s6-setuidgid nobody
if { fdmove 1 6 s6-echo ok }
fdclose 6
exec -c
s6-log -b -- s131072 t /var/log/vsftpd
s6-log -b -- __args__ t /var/log/vsftpd
@@ -102,6 +102,13 @@ PACKAGES += "${PN}-s6"
FILES_${PN}-s6 += "${s6rcsrcdir}"
RDEPENDS_${PN}:>USE_s6rc += " ${PN}-s6"
RECIPE_FLAGS += "vsftpd_log_args"
DEFAULT_USE_vsftpd_log_args = "s131072"
do_configure_s6_log() {
sed -i -e "s|__args__|${USE_vsftpd_log_args}|" ${SRCDIR}/vsftpd-log.run
}
do_configure[postfuncs] += "do_configure_s6_log"
# FIXME: do something else!
#pkg_postinst() {
# if [ "x$D" != "x" ]; then

0 comments on commit 49cba5a

Please sign in to comment.