Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
etf
cmssam
Commits
9cecebde
Commit
9cecebde
authored
Apr 15, 2019
by
Marian Babik
Browse files
added apache stop and wait
parent
e6429758
Changes
1
Hide whitespace changes
Inline
Side-by-side
docker/etf-cms/docker-entrypoint.sh
View file @
9cecebde
...
...
@@ -8,6 +8,7 @@ _term() {
fi
rm
-rf
/opt/omd/sites/etf/etc/nagios/conf.d/wlcg/
omd stop
/usr/sbin/httpd
-k
stop
}
trap
_term SIGINT SIGTERM
...
...
@@ -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/
fi
/usr/bin/omd stop
echo
"Starting crond ..."
/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
omd start
rm
-f
/opt/omd/sites/etf/etc/nagios/conf.d/handlers.cfg
echo
"Configuring main.mk:
$ETF_HOSTED_BY
"
if
[[
-z
"
${
ETF_HOSTED_BY
}
"
]]
;
then
echo
" Variable ETF_HOSTED_BY is not defined, not touching main.mk"
else
if
grep
-q
all_hosts /opt/omd/sites/
${
CHECK_MK_SITE
}
/etc/check_mk/main.mk
;
then
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
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
fi
echo
"Configuring ETF ..."
if
[[
-z
"
${
ETF_NAGIOS_HOST
}
"
]]
;
then
echo
" Variable ETF_NAGIOS_HOST is not defined, using 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
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
su etf
-c
"ncgx --log | tee /opt/omd/sites/etf/var/log/ncgx.log"
...
...
@@ -111,12 +111,6 @@ else
/usr/bin/disable_nstream
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 ..."
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"
...
...
@@ -134,5 +128,7 @@ echo "Reloading crontab ..."
su etf
-c
"omd reload crontab"
echo
"Starting Apache ..."
/usr/sbin/httpd
-DFOREGROUND
/usr/sbin/httpd
-DFOREGROUND
&
wait
$!
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment