Add check_osrf sudoers file.
authorAndy Witter <awitter@georgialibraries.org>
Tue, 20 Nov 2018 14:10:02 +0000 (09:10 -0500)
committerAndy Witter <awitter@georgialibraries.org>
Tue, 20 Nov 2018 14:10:02 +0000 (09:10 -0500)
GenaSYS.sh

index 3f30fa1..ef4c828 100755 (executable)
@@ -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 <awitter@georgialibraries.org>"
         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