From f503bcbffee6865a05283cda85fa6f65262bc669 Mon Sep 17 00:00:00 2001 From: Javi Fontan Date: Thu, 28 May 2015 16:09:00 +0200 Subject: [PATCH] bug #3743: add Debian8 directory and fix ipset path in Debian 7 --- share/pkgs/{Debian => Debian7}/opennebula | 0 .../pkgs/{Debian => Debian7}/opennebula-econe | 0 .../pkgs/{Debian => Debian7}/opennebula-flow | 0 .../pkgs/{Debian => Debian7}/opennebula-gate | 0 .../pkgs/{Debian => Debian7}/opennebula-novnc | 0 .../{Debian => Debian7}/opennebula-sunstone | 0 share/pkgs/Debian7/opennebula.sudoers | 11 ++ share/pkgs/Debian8/opennebula | 128 ++++++++++++++++++ share/pkgs/Debian8/opennebula-econe | 106 +++++++++++++++ share/pkgs/Debian8/opennebula-flow | 94 +++++++++++++ share/pkgs/Debian8/opennebula-gate | 94 +++++++++++++ share/pkgs/Debian8/opennebula-novnc | 105 ++++++++++++++ share/pkgs/Debian8/opennebula-sunstone | 108 +++++++++++++++ .../{Debian => Debian8}/opennebula.sudoers | 0 14 files changed, 646 insertions(+) rename share/pkgs/{Debian => Debian7}/opennebula (100%) rename share/pkgs/{Debian => Debian7}/opennebula-econe (100%) rename share/pkgs/{Debian => Debian7}/opennebula-flow (100%) rename share/pkgs/{Debian => Debian7}/opennebula-gate (100%) rename share/pkgs/{Debian => Debian7}/opennebula-novnc (100%) rename share/pkgs/{Debian => Debian7}/opennebula-sunstone (100%) create mode 100644 share/pkgs/Debian7/opennebula.sudoers create mode 100755 share/pkgs/Debian8/opennebula create mode 100755 share/pkgs/Debian8/opennebula-econe create mode 100755 share/pkgs/Debian8/opennebula-flow create mode 100755 share/pkgs/Debian8/opennebula-gate create mode 100755 share/pkgs/Debian8/opennebula-novnc create mode 100755 share/pkgs/Debian8/opennebula-sunstone rename share/pkgs/{Debian => Debian8}/opennebula.sudoers (100%) diff --git a/share/pkgs/Debian/opennebula b/share/pkgs/Debian7/opennebula similarity index 100% rename from share/pkgs/Debian/opennebula rename to share/pkgs/Debian7/opennebula diff --git a/share/pkgs/Debian/opennebula-econe b/share/pkgs/Debian7/opennebula-econe similarity index 100% rename from share/pkgs/Debian/opennebula-econe rename to share/pkgs/Debian7/opennebula-econe diff --git a/share/pkgs/Debian/opennebula-flow b/share/pkgs/Debian7/opennebula-flow similarity index 100% rename from share/pkgs/Debian/opennebula-flow rename to share/pkgs/Debian7/opennebula-flow diff --git a/share/pkgs/Debian/opennebula-gate b/share/pkgs/Debian7/opennebula-gate similarity index 100% rename from share/pkgs/Debian/opennebula-gate rename to share/pkgs/Debian7/opennebula-gate diff --git a/share/pkgs/Debian/opennebula-novnc b/share/pkgs/Debian7/opennebula-novnc similarity index 100% rename from share/pkgs/Debian/opennebula-novnc rename to share/pkgs/Debian7/opennebula-novnc diff --git a/share/pkgs/Debian/opennebula-sunstone b/share/pkgs/Debian7/opennebula-sunstone similarity index 100% rename from share/pkgs/Debian/opennebula-sunstone rename to share/pkgs/Debian7/opennebula-sunstone diff --git a/share/pkgs/Debian7/opennebula.sudoers b/share/pkgs/Debian7/opennebula.sudoers new file mode 100644 index 0000000000..4f75c3eec7 --- /dev/null +++ b/share/pkgs/Debian7/opennebula.sudoers @@ -0,0 +1,11 @@ +Defaults:oneadmin !requiretty +Defaults:oneadmin secure_path = /sbin:/bin:/usr/sbin:/usr/bin + +Cmnd_Alias ONE_MISC = /bin/dd, /sbin/mkfs, /bin/sync +Cmnd_Alias ONE_NET = /sbin/brctl, /sbin/ebtables, /sbin/iptables, /sbin/ip, /usr/sbin/ipset +Cmnd_Alias ONE_LVM = /sbin/lvcreate, /sbin/lvremove, /sbin/lvrename, /sbin/lvs, /sbin/vgdisplay +Cmnd_Alias ONE_ISCSI = /usr/bin/iscsiadm, /usr/sbin/tgt-admin, /usr/sbin/tgtadm +Cmnd_Alias ONE_OVS = /usr/bin/ovs-ofctl, /usr/bin/ovs-vsctl +Cmnd_Alias ONE_XEN = /usr/sbin/xentop, /usr/sbin/xl, /usr/sbin/xm + +oneadmin ALL=(ALL) NOPASSWD: ONE_MISC, ONE_NET, ONE_LVM, ONE_ISCSI, ONE_OVS, ONE_XEN diff --git a/share/pkgs/Debian8/opennebula b/share/pkgs/Debian8/opennebula new file mode 100755 index 0000000000..9d923565b4 --- /dev/null +++ b/share/pkgs/Debian8/opennebula @@ -0,0 +1,128 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: opennebula +# Required-Start: $remote_fs $syslog +# Required-Stop: $remote_fs $syslog +# Should-Start: mysql +# Should-Stop: mysql +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: OpenNebula init script +# Description: OpenNebula cloud initialisation script +### END INIT INFO + +# Author: Soren Hansen + +PATH=/sbin:/usr/sbin:/bin:/usr/bin +DESC="OpenNebula cloud" +NAME=one +DAEMON=/usr/bin/$NAME +DAEMON_ARGS="" +PIDFILE=/var/run/$NAME.pid +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 + chown oneadmin /var/run/one /var/lock/one + su oneadmin -s /bin/sh -c 'one start' +} + +# +# Function that stops the daemon/service +# +do_stop() +{ + su oneadmin -s /bin/sh -c 'one stop' +} + +do_start_sched() +{ + su oneadmin -s /bin/sh -c 'one start-sched' +} + +do_stop_sched() +{ + su oneadmin -s /bin/sh -c 'one stop-sched' +} + +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 + ;; + status) + status_of_proc "oned" "$NAME" && exit 0 || exit $? + ;; + 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 + ;; + restart-sched) + log_daemon_msg "Restarting scheduler" + do_stop_sched + 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|status}" >&2 + exit 3 + ;; +esac + +: diff --git a/share/pkgs/Debian8/opennebula-econe b/share/pkgs/Debian8/opennebula-econe new file mode 100755 index 0000000000..31003b2b0d --- /dev/null +++ b/share/pkgs/Debian8/opennebula-econe @@ -0,0 +1,106 @@ +#! /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 +PID_FILE=/var/run/one/econe-server.pid + +# 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 + ;; + status) + ECONE_PID=`cat $PID_FILE` + kill -0 $ECONE_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 + # '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|status|restart|force-reload}" >&2 + exit 3 + ;; +esac + +: diff --git a/share/pkgs/Debian8/opennebula-flow b/share/pkgs/Debian8/opennebula-flow new file mode 100755 index 0000000000..6467dd9476 --- /dev/null +++ b/share/pkgs/Debian8/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/Debian8/opennebula-gate b/share/pkgs/Debian8/opennebula-gate new file mode 100755 index 0000000000..613f2614ef --- /dev/null +++ b/share/pkgs/Debian8/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/Debian8/opennebula-novnc b/share/pkgs/Debian8/opennebula-novnc new file mode 100755 index 0000000000..f583a5fe1c --- /dev/null +++ b/share/pkgs/Debian8/opennebula-novnc @@ -0,0 +1,105 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: opennebula-novnc +# Required-Start: $remote_fs +# Required-Stop: $remote_fs +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: novnc init script +# Description: OpenNebula novnc server +### END INIT INFO + +# Author: Arnold Bechtoldt + +PATH=/sbin:/usr/sbin:/bin:/usr/bin +DESC="OpenNebula novnc server" +NAME=novnc-server +DAEMON=/usr/bin/$NAME +DAEMON_ARGS="" +SCRIPTNAME=/etc/init.d/opennebula-novnc + +# 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/lock/one /var/log/one + chown oneadmin /var/lock/one /var/log/one + su oneadmin -s /bin/sh -c "$DAEMON start" +} + +# +# Function that retrives the status of the daemon/service +# +do_status() +{ + su oneadmin -s /bin/sh -c "$DAEMON status" +} + +# +# 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 + ;; + status) + do_status && exit 0 || exit $? + ;; + 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|status|restart|force-reload}" >&2 + exit 3 + ;; +esac + +: diff --git a/share/pkgs/Debian8/opennebula-sunstone b/share/pkgs/Debian8/opennebula-sunstone new file mode 100755 index 0000000000..34e9e1fbfb --- /dev/null +++ b/share/pkgs/Debian8/opennebula-sunstone @@ -0,0 +1,108 @@ +#! /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/opennebula-sunstone +PID_FILE=/var/run/one/sunstone.pid + +# 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() +{ + service opennebula-novnc 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-sunstone" +} + +# +# Function that stops the daemon/service +# +do_stop() +{ + su oneadmin -s /bin/sh -c "$DAEMON stop-sunstone" + service opennebula-novnc 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 + ;; + status) + SUNSTONE_PID=`cat $PID_FILE` + kill -0 $SUNSTONE_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 + # '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|status|restart|force-reload}" >&2 + exit 3 + ;; +esac + +: diff --git a/share/pkgs/Debian/opennebula.sudoers b/share/pkgs/Debian8/opennebula.sudoers similarity index 100% rename from share/pkgs/Debian/opennebula.sudoers rename to share/pkgs/Debian8/opennebula.sudoers