mirror of
https://github.com/myvesta/vesta
synced 2025-08-14 02:28:05 -07:00
Fix for upstart services on Ubuntu
This commit is contained in:
parent
2593b5bd1c
commit
0072c8189a
1 changed files with 11 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue