fuel-library/deployment/puppet/umm/files/umm_svc
Peter Zhurba 2f75ff5899 Fix "Disabled UMM" functionality
Related-bug:#1456526

Change-Id: Ie6ba8508baa044806f6f87c696c465bd5351e3c5
2015-05-21 11:32:14 +03:00

38 lines
705 B
Bash
Executable File

#!/bin/bash
. /usr/lib/umm/umm_vars
# clean previos state
[ -f $UMM_FLAG ] && rm $UMM_FLAG
# check if UMM enabled
[ "$UMM" == "yes" ] || exit 0
if [ -f $UMM_DATA/UMM_ENFORCED ] ; then
echo umm >$UMM_FLAG
rm $UMM_DATA/UMM_ENFORCED
fi
# check if umm kernel parameter is present
for t in $(cat /proc/cmdline); do
[ "$t" == "umm" ] && echo umm >$UMM_FLAG
done
# check if dirty rebout count is reached
UMM_DRC=$((UMM_DRC+1))
echo "UMM_DRC=$UMM_DRC">$UMM_DATA/UMM_DRC.var
[ ${UMM_DRC} -gt ${REBOOT_COUNT} ] && echo umm >$UMM_FLAG
initctl start umm-tr || true
if [ -f $UMM_FLAG ] ; then
${0}.${UMM_R}
initctl start umm-run || true
fi
while [ -f $UMM_FLAG ] ; do sleep 1 ; done;