Skip to content
Snippets Groups Projects
Commit edb9c60d authored by Julien Leduc's avatar Julien Leduc
Browse files

echo "-$(cat /proc/1/cmdline 2>&1 | sed -e 's/\x0//g')-"

-/usr/sbin/initnone-
As I do not want a complex sed query to check for systemd or not, let's
solve it in init_pod.sh and express it in CI_CONTEXT variable.
parent ea20fd53
No related branches found
No related tags found
No related merge requests found
......@@ -39,8 +39,8 @@ echo OK
echo "Generating core file in /var/log/cta directory so that those are available as artifacts"
echo '/var/log/cta/core_%e.%p' > /proc/sys/kernel/core_pattern
if [ "-$(cat /proc/1/cmdline 2>&1 | sed -e 's/\x0//g')-" != '-/usr/sbin/init-' ]; then
# we are not running in systemd
if [ "-${CI_CONTEXT}-" == '-nosystemd-' ]; then
# systemd is not available
runuser --shell='/bin/bash' --session-command='cd ~cta; xrootd -l /var/log/cta-frontend-xrootd.log -k fifo -n cta -c /etc/cta/cta-frontend-xrootd.conf -I v4' cta
echo "ctafrontend died"
echo "analysing core file if any"
......
......@@ -28,6 +28,15 @@ echo "DONE"
#echo "ip_resolve=IPv4" >> /etc/yum.conf
#echo "DONE"
# defining CI_CONTEXT
# possible values are "systemd" and "nosystemd"
# this is just to understand if the container is managed through systemd or not
CI_CONTEXT="nosystemd"
if [ "-$(cat /proc/1/cmdline 2>&1 | sed -e 's/\x0//g;s/init.*/init/')-" == '-/usr/sbin/init-' ]; then
CI_CONTEXT="systemd"
fi
# redefining yum commands if in BUILDTREE environment
if [[ -n ${BUILDTREE_BASE} ]]; then
echo "Configuring BUILDTREE environment"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment