We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c81a2bf commit f0c5a60Copy full SHA for f0c5a60
bin/v-list-sys-services
@@ -23,12 +23,11 @@ get_srv_state() {
23
proc_name=${2-$1}
24
25
# Check service status
26
- status=1
27
- if [ ! -z "$(service $srv status| grep running)" ]; then
28
- status=0
29
- fi
+ status=$(service $srv status 2>/dev/null)
+ rc=$?
+ stopped=$(echo $status| grep stop)
30
31
- if [ $status -eq 0 ]; then
+ if [ "$rc" -eq 0 ] && [ -z "$stopped" ]; then
32
state='running'
33
34
# Calculate cpu and memory usage
0 commit comments