diff --git a/share/pkgs/Ubuntu/opennebula-flow b/share/pkgs/Ubuntu/opennebula-flow index 6467dd9476..b670b8b05b 100755 --- a/share/pkgs/Ubuntu/opennebula-flow +++ b/share/pkgs/Ubuntu/opennebula-flow @@ -17,6 +17,7 @@ NAME=oneflow-server DAEMON=/usr/bin/$NAME DAEMON_ARGS="" SCRIPTNAME=/etc/init.d/$NAME +PID_FILE=/var/run/one/oneflow.pid # Exit if the package is not installed [ -x "$DAEMON" ] || exit 0 @@ -63,6 +64,17 @@ case "$1" in 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; esac ;; + status) + PID=`cat $PID_FILE` + kill -0 $PID > /dev/null 2>&1 + if [ "$?" -eq "0" ]; then + log_daemon_msg "$NAME is running" + log_end_msg 0 + else + log_daemon_msg "$NAME is not running" + log_end_msg 1 + fi + ;; restart|force-reload) # # If the "reload" option is implemented then remove the diff --git a/share/pkgs/Ubuntu/opennebula-gate b/share/pkgs/Ubuntu/opennebula-gate index 613f2614ef..f4d7471df2 100755 --- a/share/pkgs/Ubuntu/opennebula-gate +++ b/share/pkgs/Ubuntu/opennebula-gate @@ -17,6 +17,7 @@ NAME=onegate-server DAEMON=/usr/bin/$NAME DAEMON_ARGS="" SCRIPTNAME=/etc/init.d/$NAME +PID_FILE=/var/run/one/onegate.pid # Exit if the package is not installed [ -x "$DAEMON" ] || exit 0 @@ -63,6 +64,17 @@ case "$1" in 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; esac ;; + status) + PID=`cat $PID_FILE` + kill -0 $PID > /dev/null 2>&1 + if [ "$?" -eq "0" ]; then + log_daemon_msg "$NAME is running" + log_end_msg 0 + else + log_daemon_msg "$NAME is not running" + log_end_msg 1 + fi + ;; restart|force-reload) # # If the "reload" option is implemented then remove the