Эх сурвалжийг харах

Fix for upstart services on Ubuntu

Serghey Rodin 11 жил өмнө
parent
commit
0072c8189a
1 өөрчлөгдсөн 11 нэмэгдсэн , 2 устгасан
  1. 11 2
      bin/v-list-sys-services

+ 11 - 2
bin/v-list-sys-services

@@ -23,8 +23,17 @@ get_srv_state() {
     proc_name=${2-$1}
 
     # Check service status
-    /etc/init.d/$srv status > /dev/null 2>&1
-    if [ $? -eq 0 ]; then
+    if [ -e "/etc/init.d/$srv" ]; then
+        /etc/init.d/$srv status > /dev/null 2>&1
+        status=$?
+    else
+        status=1
+        if [ ! -z "$(service $srv status| grep running)" ]; then
+            status=0
+        fi
+    fi
+
+    if [ $status -eq 0 ]; then
         state='running'
 
         # Calculate cpu and memory usage