Skip to content

Commit 1287a1e

Browse files
committed
upstart service handler
1 parent 0072c81 commit 1287a1e

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

bin/v-restart-service

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ if [ -x "/etc/init.d/$service" ]; then
4141
rm -f $tmpfile
4242
exit $E_RESTART
4343
fi
44+
else
45+
service $service restart >/dev/null 2>&1
46+
if [ $? -ne 0 ]; then
47+
exit $E_RESTART
48+
fi
4449
fi
4550

4651

bin/v-start-service

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ if [ -x "/etc/init.d/$service" ]; then
3232
if [ $? -ne 0 ]; then
3333
exit $E_RESTART
3434
fi
35+
else
36+
service $service start >/dev/null 2>&1
37+
if [ $? -ne 0 ]; then
38+
exit $E_RESTART
39+
fi
3540
fi
3641

3742

bin/v-stop-service

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ if [ -x "/etc/init.d/$service" ]; then
3232
if [ $? -ne 0 ]; then
3333
exit $E_RESTART
3434
fi
35+
else
36+
service $service stop >/dev/null 2>&1
37+
if [ $? -ne 0 ]; then
38+
exit $E_RESTART
39+
fi
3540
fi
3641

3742

0 commit comments

Comments
 (0)