diff --git a/share/pkgs/CentOS/opennebula-econe b/share/pkgs/CentOS/opennebula-econe old mode 100644 new mode 100755 diff --git a/share/pkgs/CentOS/opennebula-ozones b/share/pkgs/CentOS/opennebula-ozones new file mode 100755 index 0000000000..0c616034b9 --- /dev/null +++ b/share/pkgs/CentOS/opennebula-ozones @@ -0,0 +1,98 @@ +#!/bin/bash +# +# /etc/rc.d/init.d/opennebula-ozones +# +# Starts the OpenNebula oZones Server +# +# chkconfig: 345 66 34 +# description: Starts the oZones Server daemon +# processname: opennebula-ozones + +### BEGIN INIT INFO +# Provides: opennebula-ozones +# Required-Start: $local_fs $remote_fs oned +# Required-Stop: $local_fs $remote_fs oned +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: start and stop opennebula-ozones +# Description: start and stop opennebula-ozones +### END INIT INFO + +prog="opennebula-ozones" + +SERVER_BIN=/usr/bin/ozones-server +SERVER_PROGRAM=ozones-server.rb +LOCKFILE=/var/lock/subsys/${prog} +PID_FILE=/var/run/${prog}.pid + +# Source function library. +. /etc/rc.d/init.d/functions + + +RETVAL=0 + +check() { + # Check that we're a privileged user + [ `id -u` = 0 ] || exit 4 + + # Check if $SERVER_BIN is executable + test -x $SERVER_BIN || exit 5 +} + +start() { + check + + echo -n $"Starting $prog Server: " + daemon --user oneadmin $SERVER_BIN start + RETVAL=$? + + echo + [ $RETVAL -eq 0 ] && { + touch $LOCKFILE + echo $(ps -ef|grep $SERVER_PROGRAM | awk '{print $2}') > $PID_FILE + } + + return $RETVAL +} + +stop() { + + check + + echo -n $"Stopping $prog Server daemon: " + daemon --user oneadmin $SERVER_BIN stop + RETVAL=$? + + [ $RETVAL -eq 0 ] && success || failure + echo + [ $RETVAL -eq 0 ] && rm -f $LOCKFILE $PID_FILE + + return $RETVAL +} + +restart() { + stop + start +} + + +case "$1" in +start) + start + ;; +stop) + stop + ;; +restart) + restart + ;; +status) + status $prog + RETVAL=$? + ;; +*) + echo $"Usage: $0 {start|stop|status|restart}" + RETVAL=2 +esac + +exit $RETVAL diff --git a/share/pkgs/Debian/opennebula-econe b/share/pkgs/Debian/opennebula-econe old mode 100644 new mode 100755 diff --git a/share/pkgs/Debian/opennebula-flow b/share/pkgs/Debian/opennebula-flow old mode 100644 new mode 100755 diff --git a/share/pkgs/Debian/opennebula-gate b/share/pkgs/Debian/opennebula-gate old mode 100644 new mode 100755 diff --git a/share/pkgs/Debian/opennebula-occi b/share/pkgs/Debian/opennebula-occi old mode 100644 new mode 100755 diff --git a/share/pkgs/Debian/opennebula-ozones b/share/pkgs/Debian/opennebula-ozones new file mode 100755 index 0000000000..47564e7895 --- /dev/null +++ b/share/pkgs/Debian/opennebula-ozones @@ -0,0 +1,94 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: opennebula-ozones +# Required-Start: $remote_fs +# Required-Stop: $remote_fs +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: oZones Server init script +# Description: OpenNebula oZones service initialisation script +### END INIT INFO + +# Author: Tino Vázquez + +PATH=/sbin:/usr/sbin:/bin:/usr/bin +DESC="oZones Service" +NAME=ozones-server +DAEMON=/usr/bin/$NAME +DAEMON_ARGS="" +SCRIPTNAME=/etc/init.d/$NAME + +# Exit if the package is not installed +[ -x "$DAEMON" ] || exit 0 + +# Load the VERBOSE setting and other rcS variables +. /lib/init/vars.sh + +# Define LSB log_* functions. +# Depend on lsb-base (>= 3.0-6) to ensure that this file is present. +. /lib/lsb/init-functions + +# +# Function that starts the daemon/service +# +do_start() +{ + mkdir -p /var/run/one /var/lock/one /var/log/one + chown oneadmin /var/run/one /var/lock/one /var/log/one + su oneadmin -s /bin/sh -c "$DAEMON start" +} + +# +# Function that stops the daemon/service +# +do_stop() +{ + su oneadmin -s /bin/sh -c "$DAEMON stop" +} + +case "$1" in + start) + [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME" + do_start + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + ;; + stop) + [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" + do_stop + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + ;; + restart|force-reload) + # + # If the "reload" option is implemented then remove the + # 'force-reload' alias + # + log_daemon_msg "Restarting $DESC" "$NAME" + do_stop + case "$?" in + 0|1) + do_start + case "$?" in + 0) log_end_msg 0 ;; + 1) log_end_msg 1 ;; # Old process is still running + *) log_end_msg 1 ;; # Failed to start + esac + ;; + *) + # Failed to stop + log_end_msg 1 + ;; + esac + ;; + *) + echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2 + exit 3 + ;; +esac + +: diff --git a/share/pkgs/Debian/opennebula-sunstone b/share/pkgs/Debian/opennebula-sunstone old mode 100644 new mode 100755 diff --git a/share/pkgs/Ubuntu/opennebula-econe b/share/pkgs/Ubuntu/opennebula-econe new file mode 100755 index 0000000000..db2bbd625a --- /dev/null +++ b/share/pkgs/Ubuntu/opennebula-econe @@ -0,0 +1,94 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: opennebula-econe +# Required-Start: $remote_fs +# Required-Stop: $remote_fs +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: ECONE Server init script +# Description: OpenNebula ECONE service initialisation script +### END INIT INFO + +# Author: Tino Vázquez + +PATH=/sbin:/usr/sbin:/bin:/usr/bin +DESC="ECONE Service" +NAME=econe-server +DAEMON=/usr/bin/$NAME +DAEMON_ARGS="" +SCRIPTNAME=/etc/init.d/$NAME + +# Exit if the package is not installed +[ -x "$DAEMON" ] || exit 0 + +# Load the VERBOSE setting and other rcS variables +. /lib/init/vars.sh + +# Define LSB log_* functions. +# Depend on lsb-base (>= 3.0-6) to ensure that this file is present. +. /lib/lsb/init-functions + +# +# Function that starts the daemon/service +# +do_start() +{ + mkdir -p /var/run/one /var/lock/one /var/log/one + chown oneadmin /var/run/one /var/lock/one /var/log/one + su oneadmin -s /bin/sh -c "$DAEMON start" +} + +# +# Function that stops the daemon/service +# +do_stop() +{ + su oneadmin -s /bin/sh -c "$DAEMON stop" +} + +case "$1" in + start) + [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME" + do_start + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + ;; + stop) + [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" + do_stop + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + ;; + restart|force-reload) + # + # If the "reload" option is implemented then remove the + # 'force-reload' alias + # + log_daemon_msg "Restarting $DESC" "$NAME" + do_stop + case "$?" in + 0|1) + do_start + case "$?" in + 0) log_end_msg 0 ;; + 1) log_end_msg 1 ;; # Old process is still running + *) log_end_msg 1 ;; # Failed to start + esac + ;; + *) + # Failed to stop + log_end_msg 1 + ;; + esac + ;; + *) + echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2 + exit 3 + ;; +esac + +: diff --git a/share/pkgs/Ubuntu/opennebula-flow b/share/pkgs/Ubuntu/opennebula-flow new file mode 100755 index 0000000000..6467dd9476 --- /dev/null +++ b/share/pkgs/Ubuntu/opennebula-flow @@ -0,0 +1,94 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: opennebula-flow +# Required-Start: $remote_fs +# Required-Stop: $remote_fs +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: OneFlow init script +# Description: OpenNebula OneFlow service initialisation script +### END INIT INFO + +# Author: Tino Vázquez + +PATH=/sbin:/usr/sbin:/bin:/usr/bin +DESC="OneFlow Service" +NAME=oneflow-server +DAEMON=/usr/bin/$NAME +DAEMON_ARGS="" +SCRIPTNAME=/etc/init.d/$NAME + +# Exit if the package is not installed +[ -x "$DAEMON" ] || exit 0 + +# Load the VERBOSE setting and other rcS variables +. /lib/init/vars.sh + +# Define LSB log_* functions. +# Depend on lsb-base (>= 3.0-6) to ensure that this file is present. +. /lib/lsb/init-functions + +# +# Function that starts the daemon/service +# +do_start() +{ + mkdir -p /var/run/one /var/lock/one /var/log/one + chown oneadmin /var/run/one /var/lock/one /var/log/one + su oneadmin -s /bin/sh -c "$DAEMON start" +} + +# +# Function that stops the daemon/service +# +do_stop() +{ + su oneadmin -s /bin/sh -c "$DAEMON stop" +} + +case "$1" in + start) + [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME" + do_start + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + ;; + stop) + [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" + do_stop + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + ;; + restart|force-reload) + # + # If the "reload" option is implemented then remove the + # 'force-reload' alias + # + log_daemon_msg "Restarting $DESC" "$NAME" + do_stop + case "$?" in + 0|1) + do_start + case "$?" in + 0) log_end_msg 0 ;; + 1) log_end_msg 1 ;; # Old process is still running + *) log_end_msg 1 ;; # Failed to start + esac + ;; + *) + # Failed to stop + log_end_msg 1 + ;; + esac + ;; + *) + echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2 + exit 3 + ;; +esac + +: diff --git a/share/pkgs/Ubuntu/opennebula-gate b/share/pkgs/Ubuntu/opennebula-gate new file mode 100755 index 0000000000..613f2614ef --- /dev/null +++ b/share/pkgs/Ubuntu/opennebula-gate @@ -0,0 +1,94 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: opennebula-gate +# Required-Start: $remote_fs +# Required-Stop: $remote_fs +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: OneGate init script +# Description: OpenNebula OneGate service initialisation script +### END INIT INFO + +# Author: Tino Vázquez + +PATH=/sbin:/usr/sbin:/bin:/usr/bin +DESC="OneGate Service" +NAME=onegate-server +DAEMON=/usr/bin/$NAME +DAEMON_ARGS="" +SCRIPTNAME=/etc/init.d/$NAME + +# Exit if the package is not installed +[ -x "$DAEMON" ] || exit 0 + +# Load the VERBOSE setting and other rcS variables +. /lib/init/vars.sh + +# Define LSB log_* functions. +# Depend on lsb-base (>= 3.0-6) to ensure that this file is present. +. /lib/lsb/init-functions + +# +# Function that starts the daemon/service +# +do_start() +{ + mkdir -p /var/run/one /var/lock/one /var/log/one + chown oneadmin /var/run/one /var/lock/one /var/log/one + su oneadmin -s /bin/sh -c "$DAEMON start" +} + +# +# Function that stops the daemon/service +# +do_stop() +{ + su oneadmin -s /bin/sh -c "$DAEMON stop" +} + +case "$1" in + start) + [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME" + do_start + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + ;; + stop) + [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" + do_stop + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + ;; + restart|force-reload) + # + # If the "reload" option is implemented then remove the + # 'force-reload' alias + # + log_daemon_msg "Restarting $DESC" "$NAME" + do_stop + case "$?" in + 0|1) + do_start + case "$?" in + 0) log_end_msg 0 ;; + 1) log_end_msg 1 ;; # Old process is still running + *) log_end_msg 1 ;; # Failed to start + esac + ;; + *) + # Failed to stop + log_end_msg 1 + ;; + esac + ;; + *) + echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2 + exit 3 + ;; +esac + +: diff --git a/share/pkgs/Ubuntu/opennebula-occi b/share/pkgs/Ubuntu/opennebula-occi new file mode 100755 index 0000000000..c0816c2811 --- /dev/null +++ b/share/pkgs/Ubuntu/opennebula-occi @@ -0,0 +1,94 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: opennebula-occi +# Required-Start: $remote_fs +# Required-Stop: $remote_fs +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: OCCI Server init script +# Description: OpenNebula OCCI service initialisation script +### END INIT INFO + +# Author: Tino Vázquez + +PATH=/sbin:/usr/sbin:/bin:/usr/bin +DESC="OCCI Service" +NAME=occi-server +DAEMON=/usr/bin/$NAME +DAEMON_ARGS="" +SCRIPTNAME=/etc/init.d/$NAME + +# Exit if the package is not installed +[ -x "$DAEMON" ] || exit 0 + +# Load the VERBOSE setting and other rcS variables +. /lib/init/vars.sh + +# Define LSB log_* functions. +# Depend on lsb-base (>= 3.0-6) to ensure that this file is present. +. /lib/lsb/init-functions + +# +# Function that starts the daemon/service +# +do_start() +{ + mkdir -p /var/run/one /var/lock/one /var/log/one + chown oneadmin /var/run/one /var/lock/one /var/log/one + su oneadmin -s /bin/sh -c "$DAEMON start" +} + +# +# Function that stops the daemon/service +# +do_stop() +{ + su oneadmin -s /bin/sh -c "$DAEMON stop" +} + +case "$1" in + start) + [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME" + do_start + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + ;; + stop) + [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" + do_stop + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + ;; + restart|force-reload) + # + # If the "reload" option is implemented then remove the + # 'force-reload' alias + # + log_daemon_msg "Restarting $DESC" "$NAME" + do_stop + case "$?" in + 0|1) + do_start + case "$?" in + 0) log_end_msg 0 ;; + 1) log_end_msg 1 ;; # Old process is still running + *) log_end_msg 1 ;; # Failed to start + esac + ;; + *) + # Failed to stop + log_end_msg 1 + ;; + esac + ;; + *) + echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2 + exit 3 + ;; +esac + +: diff --git a/share/pkgs/Ubuntu/opennebula-ozones b/share/pkgs/Ubuntu/opennebula-ozones new file mode 100755 index 0000000000..47564e7895 --- /dev/null +++ b/share/pkgs/Ubuntu/opennebula-ozones @@ -0,0 +1,94 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: opennebula-ozones +# Required-Start: $remote_fs +# Required-Stop: $remote_fs +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: oZones Server init script +# Description: OpenNebula oZones service initialisation script +### END INIT INFO + +# Author: Tino Vázquez + +PATH=/sbin:/usr/sbin:/bin:/usr/bin +DESC="oZones Service" +NAME=ozones-server +DAEMON=/usr/bin/$NAME +DAEMON_ARGS="" +SCRIPTNAME=/etc/init.d/$NAME + +# Exit if the package is not installed +[ -x "$DAEMON" ] || exit 0 + +# Load the VERBOSE setting and other rcS variables +. /lib/init/vars.sh + +# Define LSB log_* functions. +# Depend on lsb-base (>= 3.0-6) to ensure that this file is present. +. /lib/lsb/init-functions + +# +# Function that starts the daemon/service +# +do_start() +{ + mkdir -p /var/run/one /var/lock/one /var/log/one + chown oneadmin /var/run/one /var/lock/one /var/log/one + su oneadmin -s /bin/sh -c "$DAEMON start" +} + +# +# Function that stops the daemon/service +# +do_stop() +{ + su oneadmin -s /bin/sh -c "$DAEMON stop" +} + +case "$1" in + start) + [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME" + do_start + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + ;; + stop) + [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" + do_stop + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + ;; + restart|force-reload) + # + # If the "reload" option is implemented then remove the + # 'force-reload' alias + # + log_daemon_msg "Restarting $DESC" "$NAME" + do_stop + case "$?" in + 0|1) + do_start + case "$?" in + 0) log_end_msg 0 ;; + 1) log_end_msg 1 ;; # Old process is still running + *) log_end_msg 1 ;; # Failed to start + esac + ;; + *) + # Failed to stop + log_end_msg 1 + ;; + esac + ;; + *) + echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2 + exit 3 + ;; +esac + +: diff --git a/share/pkgs/Ubuntu/opennebula-sunstone b/share/pkgs/Ubuntu/opennebula-sunstone new file mode 100755 index 0000000000..f7917044d3 --- /dev/null +++ b/share/pkgs/Ubuntu/opennebula-sunstone @@ -0,0 +1,94 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: opennebula-sunstone +# Required-Start: $remote_fs +# Required-Stop: $remote_fs +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Sunstone init script +# Description: OpenNebula Sunstone web interface cloud initialisation script +### END INIT INFO + +# Author: Jaime Melis + +PATH=/sbin:/usr/sbin:/bin:/usr/bin +DESC="Sunstone Web interface" +NAME=sunstone-server +DAEMON=/usr/bin/$NAME +DAEMON_ARGS="" +SCRIPTNAME=/etc/init.d/$NAME + +# Exit if the package is not installed +[ -x "$DAEMON" ] || exit 0 + +# Load the VERBOSE setting and other rcS variables +. /lib/init/vars.sh + +# Define LSB log_* functions. +# Depend on lsb-base (>= 3.0-6) to ensure that this file is present. +. /lib/lsb/init-functions + +# +# Function that starts the daemon/service +# +do_start() +{ + mkdir -p /var/run/one /var/lock/one /var/log/one + chown oneadmin /var/run/one /var/lock/one /var/log/one + su oneadmin -s /bin/sh -c "$DAEMON start" +} + +# +# Function that stops the daemon/service +# +do_stop() +{ + su oneadmin -s /bin/sh -c "$DAEMON stop" +} + +case "$1" in + start) + [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME" + do_start + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + ;; + stop) + [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" + do_stop + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + ;; + restart|force-reload) + # + # If the "reload" option is implemented then remove the + # 'force-reload' alias + # + log_daemon_msg "Restarting $DESC" "$NAME" + do_stop + case "$?" in + 0|1) + do_start + case "$?" in + 0) log_end_msg 0 ;; + 1) log_end_msg 1 ;; # Old process is still running + *) log_end_msg 1 ;; # Failed to start + esac + ;; + *) + # Failed to stop + log_end_msg 1 + ;; + esac + ;; + *) + echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2 + exit 3 + ;; +esac + +: