From: Andy Witter Date: Tue, 20 Nov 2018 14:10:02 +0000 (-0500) Subject: Add check_osrf sudoers file. X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=e6edb3eb207e1a2cfe38b1857a429a9f96427cfc;p=contrib%2Fpines%2Fgenasys.git Add check_osrf sudoers file. --- diff --git a/GenaSYS.sh b/GenaSYS.sh index 3f30fa1..ef4c828 100755 --- a/GenaSYS.sh +++ b/GenaSYS.sh @@ -25,8 +25,8 @@ PURPOSE_="Generate config files needed for Evergreen-ILS Cluster" SYNOPSIS_="$NAME_" REQUIRES_="standard GNU commands, apt, dpkg" - VERSION_="1.90" - DATE_="2010-11-23; last update: 2018-11-08" + VERSION_="1.91" + DATE_="2010-11-23; last update: 2018-11-20" AUTHOR_="Andy Witter " URL_="http://evergreen-ils.org" CATEGORY_="devel" @@ -1979,6 +1979,7 @@ for BRICK in $(seq $BRICKCOUNT) eval cp -f $TEMPLATEDIR/rsyslog/50-default.conf ${OUTDIR}/\$BRICKHOSTNAME${BRICK}/\$BRICKHOSTNAME${BRICK}-head/etc/rsyslog.d eval cp -f $TEMPLATEDIR/systemd/autogen.service ${OUTDIR}/\$BRICKHOSTNAME${BRICK}/\$BRICKHOSTNAME${BRICK}-head/etc/systemd/system eval cp -f $TEMPLATEDIR/systemd/opensrf.sudoers ${OUTDIR}/\$BRICKHOSTNAME${BRICK}/\$BRICKHOSTNAME${BRICK}-head/etc/sudoers.d/opensrf + eval cp -f $TEMPLATEDIR/monitor/check_osrf.sudoers ${OUTDIR}/\$BRICKHOSTNAME${BRICK}/\$BRICKHOSTNAME${BRICK}-head/etc/sudoers.d/nagios #eval sed -i "s^CLUSTER_DOMAINNAME^${CLUSTERDOMAINNAME}^g" ${OUTDIR}/\$BRICKHOSTNAME${BRICK}/\$BRICKHOSTNAME${BRICK}-head/etc/60-evergreen-ils.conf eval echo "\$BRICKHOSTNAME${BRICK}-head" > ${OUTDIR}/$(eval echo \$BRICKHOSTNAME${BRICK})/$(eval echo \$BRICKHOSTNAME${BRICK})-head/etc/hostname @@ -2151,7 +2152,8 @@ for BRICK in $(seq $BRICKCOUNT) eval cp -f $TMPFOLDER/60-evergreen-ils.conf ${OUTDIR}/\$BRICKHOSTNAME${BRICK}/\$BRICKHOSTNAME${BRICK}-head/etc/rsyslog.d eval cp -f $TEMPLATEDIR/rsyslog/50-default.conf ${OUTDIR}/\$BRICKHOSTNAME${BRICK}/\$BRICKHOSTNAME${BRICK}-head/etc/rsyslog.d eval cp -f $TEMPLATEDIR/systemd/autogen.service ${OUTDIR}/\$BRICKHOSTNAME${BRICK}/\$BRICKHOSTNAME${BRICK}-head/etc/systemd/system - eval cp -f $TEMPLATEDIR/systemd/opensrf.sudoers ${OUTDIR}/\$BRICKHOSTNAME${BRICK}/\$BRICKHOSTNAME${BRICK}-head/etc/sudoers.d + eval cp -f $TEMPLATEDIR/systemd/opensrf.sudoers ${OUTDIR}/\$BRICKHOSTNAME${BRICK}/\$BRICKHOSTNAME${BRICK}-head/etc/sudoers.d/opensrf + eval cp -f $TEMPLATEDIR/monitor/check_osrf.sudoers ${OUTDIR}/\$BRICKHOSTNAME${BRICK}/\$BRICKHOSTNAME${BRICK}-head/etc/sudoers.d/nagios #eval cp -f /tmp/rsyslog.conf ${OUTDIR}/\$BRICKHOSTNAME${BRICK}/\$BRICKHOSTNAME${BRICK}-head/etc/ eval echo "\$BRICKHOSTNAME${BRICK}-head" > ${OUTDIR}/$(eval echo \$BRICKHOSTNAME${BRICK})/$(eval echo \$BRICKHOSTNAME${BRICK})-head/etc/hostname eval echo "\$BRICKHOSTNAME${BRICK}-head" >> $TMPOSRFNODES @@ -2658,11 +2660,14 @@ do cat $TEMPLATEDIR/opensrf.xml/opensrf.xml-footer >> "$OUTDIR/$OTHERNODE/openils/conf/opensrf.xml" done +### Add stuff to sudoers.d for opensrf nodes that are not bricks ### make sure user opensrf can restart apache when opensrf is restart on nodes that opensrf is installed +### Also make sure user nagios can run check_osrf for OSRF_SUDO_NODE in $MACHINES_OSRF_NO_BRICKS do mkdir -p "$OUTDIR/$OSRF_SUDO_NODE/etc/sudoers.d" cp -f "${TEMPLATEDIR}/systemd/opensrf.sudoers" "$OUTDIR/${OSRF_SUDO_NODE}/etc/sudoers.d/opensrf" + cp -f "${TEMPLATEDIR}/monitor/check_osrf.sudoers" "$OUTDIR/${OSRF_SUDO_NODE}/etc/sudoers.d/nagios" done