diff options
author | mboelen <michael@cisofy.com> | 2016-03-17 22:32:21 +0300 |
---|---|---|
committer | mboelen <michael@cisofy.com> | 2016-03-17 22:32:21 +0300 |
commit | a427eb6fa77a10a33db9e9c6315d0ea5cddea6bd (patch) | |
tree | 197875c07916b15d46b36b9f7cf6a0a507ac39a6 | |
parent | e399b49e1e28ccd7ad3ed86145a3735a496fe6b9 (diff) |
Rewrote test to determine system manager
-rw-r--r-- | include/tests_boot_services | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/include/tests_boot_services b/include/tests_boot_services index 1a225cc3..0e0a18af 100644 --- a/include/tests_boot_services +++ b/include/tests_boot_services @@ -70,9 +70,21 @@ case ${OS} in "Linux") if [ -f /proc/1/cmdline ]; then - FIND=`awk '/(^\/|init)/ { print $1 }' /proc/1/cmdline` - if [ ! "${FIND}" = "" ]; then - SHORTNAME=`echo ${FIND} | awk -F/ '{ print $NF }'` + FILENAME=`awk '/(^\/|init)/ { print $1 }' /proc/1/cmdline` + LogText "Result: cmdline found = ${FILENAME}" + ISFILE=`echo ${FILENAME} | grep "^/"` + if [ ! "${ISFILE}" = "" ]; then + if [ -L ${ISFILE} ]; then + ShowSymlinkPath ${ISFILE} + FILENAME="${SYMLINK}" + elif [ -f ${ISFILE} ]; then + FILENAME="${ISFILE}" + else + LogText "Result: cmdline of PID 1 is not a file" + fi + fi + if [ ! "${FILENAME}" = "" ]; then + SHORTNAME=`echo ${FILENAME} | awk -F/ '{ print $NF }'` LogText "Found: ${SHORTNAME}" case ${SHORTNAME} in "init") |