Browse Source

Improve error logging during service restart

Kristan Kenney 6 years ago
parent
commit
538a1bcb6b
1 changed files with 4 additions and 0 deletions
  1. 4 0
      bin/v-restart-service

+ 4 - 0
bin/v-restart-service

@@ -43,6 +43,10 @@ elif [ "$service" = "iptables" ]; then
     fi
 else 
     systemctl restart $service > /dev/null 2>&1
+    if [ $? -ne 0 ]; then
+        check_result $E_RESTART "ERROR: Restart of $service failed."
+        log_history "Restart of $service failed."
+    fi
 fi
 
 #----------------------------------------------------------#