diff --git a/check_systemd_service.sh b/check_systemd_service.sh index 2780c7e..f3e1858 100755 --- a/check_systemd_service.sh +++ b/check_systemd_service.sh @@ -48,7 +48,10 @@ fi active=$(systemctl is-active "$UNIT") substate=$(systemctl show "$UNIT" --property=SubState --value) -if [ "$active" != "active" ] || { [ "$substate" = "exited" ] && [ "$IS_TIMER" = false ]; }; then +if [ "$active" = "activating" ]; then + echo "WARNING - $UNIT is activating" + exit 1 +elif [ "$active" != "active" ] || { [ "$substate" = "exited" ] && [ "$IS_TIMER" = false ]; }; then echo "CRITICAL - $UNIT is not active" exit 2 fi