Merge pull request #2477 from bcambl/debug_init_service_check

fix debug service check via sysvinit
This commit is contained in:
Mark Drobnak 2018-11-07 17:50:32 -05:00 committed by GitHub
commit bbb759c684
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -836,9 +836,13 @@ process_status(){
local status_of_process local status_of_process
status_of_process=$(systemctl is-active "${i}") status_of_process=$(systemctl is-active "${i}")
else else
# Otherwise, use the service command # Otherwise, use the service command and mock the output of `systemctl is-active`
local status_of_process local status_of_process
status_of_process=$(service "${i}" status | awk '/Active:/ {print $2}') &> /dev/null if service "${i}" status | grep -E 'is\srunning' &> /dev/null; then
status_of_process="active"
else
status_of_process="inactive"
fi
fi fi
# and print it out to the user # and print it out to the user
if [[ "${status_of_process}" == "active" ]]; then if [[ "${status_of_process}" == "active" ]]; then