Skip to content

Commit

Permalink
When switching to rsyslogd, update logadm.conf
Browse files Browse the repository at this point in the history
  • Loading branch information
citrus-it committed Apr 25, 2021
1 parent 3a1d7a8 commit 92e4383
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 4 deletions.
2 changes: 2 additions & 0 deletions build/ami
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down
2 changes: 2 additions & 0 deletions build/azure
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down
2 changes: 2 additions & 0 deletions build/bhyve
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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}
Expand Down
6 changes: 4 additions & 2 deletions installer/dialog-install
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions installer/rpool-install
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions lib/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 92e4383

Please sign in to comment.