From 92e4383bfcd9590c4a559e1415fb6075cfe03d14 Mon Sep 17 00:00:00 2001 From: Andy Fiddaman Date: Sun, 25 Apr 2021 09:51:30 +0000 Subject: [PATCH] When switching to rsyslogd, update logadm.conf --- build/ami | 2 ++ build/azure | 2 ++ build/bhyve | 2 ++ installer/dialog-install | 6 ++++-- installer/rpool-install | 6 ++++-- lib/utils.sh | 8 ++++++++ 6 files changed, 22 insertions(+), 4 deletions(-) diff --git a/build/ami b/build/ami index 5979edc..d21d84f 100755 --- a/build/ami +++ b/build/ami @@ -19,6 +19,7 @@ SRCDIR=`dirname $0` [ ${SRCDIR:0:1} = "/" ] || SRCDIR=`pwd`/$SRCDIR . $SRCDIR/../lib/hvm_help.sh +. $SRCDIR/../lib/utils.sh [ -z "$BUILDSEND_MP" ] && BUILDSEND_MP=/kayak_image @@ -45,6 +46,7 @@ customise() { log "... installing noautofs profile" img_install_profile $root $SRCDIR/../etc/noautofs.xml img_install_profile $root $SRCDIR/../etc/rsyslog.xml + logadm_rsyslog $root # Decrease boot delay cat << EOM > $root/boot/loader.conf.local diff --git a/build/azure b/build/azure index 0a38c02..98db119 100755 --- a/build/azure +++ b/build/azure @@ -19,6 +19,7 @@ SRCDIR=`dirname $0` [ ${SRCDIR:0:1} = "/" ] || SRCDIR=`pwd`/$SRCDIR . $SRCDIR/../lib/hvm_help.sh +. $SRCDIR/../lib/utils.sh [ -z "$BUILDSEND_MP" ] && BUILDSEND_MP=/kayak_image @@ -40,6 +41,7 @@ customise() { log "... installing azure profile" img_install_profile $root $SRCDIR/../etc/azure.xml img_install_profile $root $SRCDIR/../etc/rsyslog.xml + logadm_rsyslog $root img_postboot_block $root << EOM /sbin/ipadm create-if hv_netvsc0 | tee /dev/msglog diff --git a/build/bhyve b/build/bhyve index e1e189f..7084d4b 100755 --- a/build/bhyve +++ b/build/bhyve @@ -19,6 +19,7 @@ SRCDIR=`dirname $0` [ ${SRCDIR:0:1} = "/" ] || SRCDIR=`pwd`/$SRCDIR . $SRCDIR/../lib/hvm_help.sh +. $SRCDIR/../lib/utils.sh [ -z "$BUILDSEND_MP" ] && BUILDSEND_MP=/kayak_image @@ -37,6 +38,7 @@ customise() { log "... installing noautofs profile" img_install_profile $root $SRCDIR/../etc/noautofs.xml img_install_profile $root $SRCDIR/../etc/rsyslog.xml + logadm_rsyslog $root img_postboot_block $root << EOM /bin/cp /etc/nsswitch.{dns,conf} diff --git a/installer/dialog-install b/installer/dialog-install index 8841e80..d5447ca 100755 --- a/installer/dialog-install +++ b/installer/dialog-install @@ -427,8 +427,10 @@ MakeBootable $RPOOL $bename || bomb "Could not make bootable" logcmd cp /kayak/etc/nossh.xml $ALTROOT/etc/svc/profile/site/ # Use rsyslog as the default log daemon -[ -f /kayak/etc/rsyslog.xml ] && \ - logcmd cp /kayak/etc/rsyslog.xml $ALTROOT/etc/svc/profile/site/ +if [ -f /kayak/etc/rsyslog.xml ]; then + logcmd cp /kayak/etc/rsyslog.xml $ALTROOT/etc/svc/profile/site/ + logadm_rsyslog $ALTROOT +fi # Add extra repo (can be disabled in the configuration menu) extrarepo -on diff --git a/installer/rpool-install b/installer/rpool-install index 4a550ff..8853abb 100644 --- a/installer/rpool-install +++ b/installer/rpool-install @@ -62,8 +62,10 @@ MakeBootable $RPOOL $bename cp /kayak/etc/nossh.xml $ALTROOT/etc/svc/profile/site/ # Use rsyslog as the default log daemon -[ -f /kayak/etc/rsyslog.xml ] && \ - logcmd cp /kayak/etc/rsyslog.xml $ALTROOT/etc/svc/profile/site/ +if [ -f /kayak/etc/rsyslog.xml ]; then + logcmd cp /kayak/etc/rsyslog.xml $ALTROOT/etc/svc/profile/site/ + logadm_rsyslog $ALTROOT +fi # Add extra repo (can be disabled in the configuration menu) extrarepo -on diff --git a/lib/utils.sh b/lib/utils.sh index 3f1a88b..6b6b328 100644 --- a/lib/utils.sh +++ b/lib/utils.sh @@ -105,5 +105,13 @@ SUPATH=/usr/sbin:/sbin:/opt/ooce/sbin:/usr/bin:/opt/ooce/bin runpkg publisher } +function logadm_rsyslog { + typeset altroot="${1:?altroot}" + + sed -i ' + s^/var/run/syslog.pid^/var/run/rsyslogd.pid^ + ' $altroot/etc/logadm.conf +} + # Vim hints # vim:ts=4:sw=4:et:fdm=marker