From 0072c8189a58dd20dbc711b26eec0848d6b7cfb5 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Wed, 14 May 2014 16:43:39 +0300 Subject: [PATCH] Fix for upstart services on Ubuntu --- bin/v-list-sys-services | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/bin/v-list-sys-services b/bin/v-list-sys-services index 78bf646b..87f57ffe 100755 --- a/bin/v-list-sys-services +++ b/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