From: Andy Witter Date: Mon, 7 Jan 2019 17:44:17 +0000 (-0500) Subject: Create new apache2.sevice unit for systemd based on generated wrapper to add Partof... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=0039ce44c220f1466272ffc9ad48d74ede45455c;p=contrib%2Fpines%2Fgenasys.git Create new apache2.sevice unit for systemd based on generated wrapper to add Partof directive for automatic restart of apache2 when opensrf is restarted. --- diff --git a/GenaSYS.sh b/GenaSYS.sh index 36d7d2d..35a268c 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.93" - DATE_="2010-11-23; last update: 2019-01-05" + VERSION_="1.94" + DATE_="2010-11-23; last update: 2019-01-07" AUTHOR_="Andy Witter " URL_="http://evergreen-ils.org" CATEGORY_="devel" @@ -1979,6 +1979,7 @@ 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/apache2.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 @@ -2154,6 +2155,7 @@ 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/apache2.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 cp -f /tmp/rsyslog.conf ${OUTDIR}/\$BRICKHOSTNAME${BRICK}/\$BRICKHOSTNAME${BRICK}-head/etc/ @@ -2571,6 +2573,7 @@ done for UTILITY in $MACHINES_UTILITY; do mkdir -p "$OUTDIR/$UTILITY/etc/systemd/system" cp -f "$TEMPLATEDIR/systemd/autogen.service" "$OUTDIR/$UTILITY/etc/systemd/system" +cp -f "$TEMPLATEDIR/systemd/apache2.service" "$OUTDIR/$UTILITY/etc/systemd/system" cp -f "$TMPFOLDER/exports" "$OUTDIR/$UTILITY/etc/" ### action trigger filters for utility. diff --git a/templates/debs/opensrf_3.0.2_amd64.deb b/templates/debs/opensrf_3.0.2_amd64.deb index 4f02cac..71213b9 100644 Binary files a/templates/debs/opensrf_3.0.2_amd64.deb and b/templates/debs/opensrf_3.0.2_amd64.deb differ diff --git a/templates/systemd/apache2.service b/templates/systemd/apache2.service new file mode 100644 index 0000000..9388b26 --- /dev/null +++ b/templates/systemd/apache2.service @@ -0,0 +1,33 @@ +#generated by systemd-sysv-generator, modified by pines-admins | +#Added PartOf=opensrf.service in the [Unit] section | +#Added WantedBy=multi-user.target in the [Install] section | + | +[Unit] | +Documentation=man:systemd-sysv-generator(8) | +SourcePath=/etc/init.d/apache2 | +Description=LSB: Apache2 web server | +Before=multi-user.target | +Before=graphical.target | +Before=shutdown.target | +After=local-fs.target | +After=remote-fs.target | +After=network-online.target | +After=systemd-journald-dev-log.socket | +After=nss-lookup.target | +Wants=network-online.target | +Conflicts=shutdown.target | +PartOf=opensrf.service | +[Service] | +Type=forking | +Restart=no | +TimeoutSec=5min | +IgnoreSIGPIPE=no | +KillMode=process | +GuessMainPID=no | +RemainAfterExit=yes | +ExecStart=/etc/init.d/apache2 start | +ExecStop=/etc/init.d/apache2 stop | +ExecReload=/etc/init.d/apache2 reload | + | +[Install] | +WantedBy=multi-user.target diff --git a/templates/systemd/opensrf.service b/templates/systemd/opensrf.service index 025f853..7acbf5c 100644 --- a/templates/systemd/opensrf.service +++ b/templates/systemd/opensrf.service @@ -11,7 +11,7 @@ Group=opensrf Type=oneshot RemainAfterExit=yes Environment=PATH=/openils/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin -#ExecStartPre=/bin/sleep 5 +ExecStartPre=/bin/sleep 5 ExecStart=/openils/bin/osrf_control --start-all #ExecStartPost=/bin/sleep 5 ExecStartPost=/usr/bin/sudo /bin/systemctl -q restart apache2.service