Commit 9cecebde authored by Marian Babik's avatar Marian Babik
Browse files

added apache stop and wait

parent e6429758
...@@ -8,6 +8,7 @@ _term() { ...@@ -8,6 +8,7 @@ _term() {
fi fi
rm -rf /opt/omd/sites/etf/etc/nagios/conf.d/wlcg/ rm -rf /opt/omd/sites/etf/etc/nagios/conf.d/wlcg/
omd stop omd stop
/usr/sbin/httpd -k stop
} }
trap _term SIGINT SIGTERM trap _term SIGINT SIGTERM
...@@ -48,6 +49,8 @@ if [[ -d /opt/omd/sites/etf/etc/nagios/conf.d/wlcg/ ]]; then ...@@ -48,6 +49,8 @@ if [[ -d /opt/omd/sites/etf/etc/nagios/conf.d/wlcg/ ]]; then
rm -rf /opt/omd/sites/etf/etc/nagios/conf.d/wlcg/ rm -rf /opt/omd/sites/etf/etc/nagios/conf.d/wlcg/
fi fi
/usr/bin/omd stop
echo "Starting crond ..." echo "Starting crond ..."
/usr/sbin/crond -m off -p -s /usr/sbin/crond -m off -p -s
...@@ -82,24 +85,21 @@ cp /etc/ncgx/templates/generic/handlers.cfg /opt/omd/sites/etf/etc/nagios/conf.d ...@@ -82,24 +85,21 @@ cp /etc/ncgx/templates/generic/handlers.cfg /opt/omd/sites/etf/etc/nagios/conf.d
omd start omd start
rm -f /opt/omd/sites/etf/etc/nagios/conf.d/handlers.cfg rm -f /opt/omd/sites/etf/etc/nagios/conf.d/handlers.cfg
echo "Configuring main.mk: $ETF_HOSTED_BY" echo "Configuring main.mk: $ETF_HOSTED_BY"
if [[ -z "${ETF_HOSTED_BY}" ]]; then if [[ -z "${ETF_HOSTED_BY}" ]]; then
echo " Variable ETF_HOSTED_BY is not defined, not touching main.mk" echo " Variable ETF_HOSTED_BY is not defined, not touching main.mk"
else else
if grep -q all_hosts /opt/omd/sites/${CHECK_MK_SITE}/etc/check_mk/main.mk; then grep -qF "${ETF_HOSTED_BY}" /opt/omd/sites/${CHECK_MK_SITE}/etc/check_mk/main.mk || echo "all_hosts += [ \"${ETF_HOSTED_BY}\" ]" >> /opt/omd/sites/${CHECK_MK_SITE}/etc/check_mk/main.mk
sed "s/all_hosts.*/all_hosts += [ \"${ETF_HOSTED_BY}\" ]/g" -i /opt/omd/sites/${CHECK_MK_SITE}/etc/check_mk/main.mk
else
echo "all_hosts += [ \"${ETF_HOSTED_BY}\" ]" >> /opt/omd/sites/${CHECK_MK_SITE}/etc/check_mk/main.mk
fi
fi fi
echo "Configuring ETF ..." echo "Configuring ETF ..."
if [[ -z "${ETF_NAGIOS_HOST}" ]]; then if [[ -z "${ETF_NAGIOS_HOST}" ]]; then
echo " Variable ETF_NAGIOS_HOST is not defined, using hostname" echo " Variable ETF_NAGIOS_HOST is not defined, using hostname"
ETF_NAGIOS_HOST=`hostname` ETF_NAGIOS_HOST=`hostname`
echo "NAGIOS_HOST = \"${ETF_NAGIOS_HOST}\"" >> /etc/ncgx/ncgx.cfg grep -qF "${ETF_NAGIOS_HOST}" /etc/ncgx/ncgx.cfg || echo "NAGIOS_HOST = \"${ETF_NAGIOS_HOST}\"" >> /etc/ncgx/ncgx.cfg
else else
echo "NAGIOS_HOST = \"${ETF_NAGIOS_HOST}\"" >> /etc/ncgx/ncgx.cfg grep -qF "${ETF_NAGIOS_HOST}" /etc/ncgx/ncgx.cfg || echo "NAGIOS_HOST = \"${ETF_NAGIOS_HOST}\"" >> /etc/ncgx/ncgx.cfg
fi fi
su etf -c "ncgx --log | tee /opt/omd/sites/etf/var/log/ncgx.log" su etf -c "ncgx --log | tee /opt/omd/sites/etf/var/log/ncgx.log"
...@@ -111,12 +111,6 @@ else ...@@ -111,12 +111,6 @@ else
/usr/bin/disable_nstream /usr/bin/disable_nstream
fi fi
if [[ "${ABRT_ENABLED}" -eq "1" ]] ; then
echo "Enabling abrt ..."
sed -e "s/OpenGPGCheck = yes/OpenGPGCheck = no/g" -i /etc/abrt/abrt-action-save-package-data.conf
/usr/sbin/abrtd
fi
echo "Fetching CMS credentials ..." echo "Fetching CMS credentials ..."
su etf -c "/usr/lib/nagios/plugins/globus/refresh_proxy --vo-fqan /cms/Role=lcgadmin --myproxyuser nagios -H myproxy.cern.ch -t 120 --key /opt/omd/sites/etf/etc/nagios/globus/etf_srv_key.pem --vo cms --lifetime 24 --name NagiosRetrieve-ETF-cms -x /opt/omd/sites/etf/etc/nagios/globus/userproxy.pem--cms-Role_lcgadmin --cert /opt/omd/sites/etf/etc/nagios/globus/etf_srv_cert.pem" su etf -c "/usr/lib/nagios/plugins/globus/refresh_proxy --vo-fqan /cms/Role=lcgadmin --myproxyuser nagios -H myproxy.cern.ch -t 120 --key /opt/omd/sites/etf/etc/nagios/globus/etf_srv_key.pem --vo cms --lifetime 24 --name NagiosRetrieve-ETF-cms -x /opt/omd/sites/etf/etc/nagios/globus/userproxy.pem--cms-Role_lcgadmin --cert /opt/omd/sites/etf/etc/nagios/globus/etf_srv_cert.pem"
su etf -c "/usr/lib/nagios/plugins/globus/refresh_proxy --vo-fqan /cms/Role=production --myproxyuser nagios -H myproxy.cern.ch -t 120 --key /opt/omd/sites/etf/etc/nagios/globus/etf_srv_key.pem --vo cms --lifetime 24 --name NagiosRetrieve-ETF-cms -x /opt/omd/sites/etf/etc/nagios/globus/userproxy.pem--cms-Role_production --cert /opt/omd/sites/etf/etc/nagios/globus/etf_srv_cert.pem" su etf -c "/usr/lib/nagios/plugins/globus/refresh_proxy --vo-fqan /cms/Role=production --myproxyuser nagios -H myproxy.cern.ch -t 120 --key /opt/omd/sites/etf/etc/nagios/globus/etf_srv_key.pem --vo cms --lifetime 24 --name NagiosRetrieve-ETF-cms -x /opt/omd/sites/etf/etc/nagios/globus/userproxy.pem--cms-Role_production --cert /opt/omd/sites/etf/etc/nagios/globus/etf_srv_cert.pem"
...@@ -134,5 +128,7 @@ echo "Reloading crontab ..." ...@@ -134,5 +128,7 @@ echo "Reloading crontab ..."
su etf -c "omd reload crontab" su etf -c "omd reload crontab"
echo "Starting Apache ..." echo "Starting Apache ..."
/usr/sbin/httpd -DFOREGROUND /usr/sbin/httpd -DFOREGROUND &
wait $!
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment