Search
j0ke.net Open Build Service
>
Projects
>
virtualization
:
Cloud
:
OpenNebula
:
3.0
>
opennebula3
> openneb_LSBhead.patch
Sign Up
|
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File openneb_LSBhead.patch of Package opennebula3
--- share/scripts/one.orig +++ share/scripts/one @@ -16,6 +16,32 @@ # limitations under the License. # #--------------------------------------------------------------------------- # +# /etc/init.d/one +### BEGIN INIT INFO +# Provides: one +# Required-Start: $remote_fs $syslog $network +# Required-Stop: $remote_fs $syslog +# Default-Start: 3 5 +# Default-Stop: 0 1 2 6 +# Short-Description: Cloud infrastructure service +# Description: The oned is the daemon process controlling the OpenNebula +# cloud instrastructure +### END INIT INFO + +# First reset status of this service +. /etc/rc.status +rc_reset + +# Return values acc. to LSB for all commands but status: +# 0 - success +# 1 - generic or unspecified error +# 2 - invalid or excess argument(s) +# 3 - unimplemented feature (e.g. "reload") +# 4 - insufficient privilege +# 5 - program is not installed +# 6 - program is not configured +# 7 - program is not running + if [ -z "$ONE_LOCATION" ]; then ONE_PIDDIR=/var/run/one ONE_PID=/var/run/one/oned.pid @@ -130,7 +156,7 @@ start() fi # Start the one daemon - $ONED -f 2>&1 & + /sbin/startproc -u oneadmin -g cloud $ONED -f 2>&1 LASTRC=$? LASTPID=$! @@ -153,7 +179,7 @@ start() # [-h host dispatch] max number of VMs dispatched to a given host in each # scheduling action - default: 1 - $ONE_SCHEDULER -p $PORT -t 30 -m 300 -d 30 -h 1& + /sbin/startproc -u oneadmin -g cloud $ONE_SCHEDULER -p $PORT -t 30 -m 300 -d 30 -h 1 LASTRC=$? LASTPID=$! @@ -186,7 +212,7 @@ start() if [ "$STARTED" == "false" ]; then stop - exit -1 + exit 7 fi } @@ -202,13 +228,23 @@ case "$1" in start) setup start + rc_status -v ;; stop) stop echo "oned and scheduler stopped" + rc_status -v ;; + restart) + $0 stop + $0 start + rc_status + ;; + reload) + $0 restart + ;; *) - echo "Usage: one [-b] {start|stop}" >&2 + echo "Usage: one [-b] {start|stop|reload|restart}" >&2 echo "Options:" >&2 echo " -b Backup log file." >&2 exit 3