Skip to content

Commit 0072c81

Browse files
committed
Fix for upstart services on Ubuntu
1 parent 2593b5b commit 0072c81

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

bin/v-list-sys-services

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,17 @@ get_srv_state() {
2323
proc_name=${2-$1}
2424

2525
# Check service status
26-
/etc/init.d/$srv status > /dev/null 2>&1
27-
if [ $? -eq 0 ]; then
26+
if [ -e "/etc/init.d/$srv" ]; then
27+
/etc/init.d/$srv status > /dev/null 2>&1
28+
status=$?
29+
else
30+
status=1
31+
if [ ! -z "$(service $srv status| grep running)" ]; then
32+
status=0
33+
fi
34+
fi
35+
36+
if [ $status -eq 0 ]; then
2837
state='running'
2938

3039
# Calculate cpu and memory usage

0 commit comments

Comments
 (0)