[Pkg-ofed-commits] r221 - opensm/trunk/debian
gmpc-guest at alioth.debian.org
gmpc-guest at alioth.debian.org
Wed Mar 18 16:58:57 UTC 2009
Author: gmpc-guest
Date: 2009-03-18 16:58:57 +0000 (Wed, 18 Mar 2009)
New Revision: 221
Added:
opensm/trunk/debian/opensm-boot.init
opensm/trunk/debian/opensm.postinst
opensm/trunk/debian/opensm.postrm
Modified:
opensm/trunk/debian/rules
Log:
Add init scripts to start opensm in rcS.
Needed for discovery of SRP targets before LVM starts.
Added: opensm/trunk/debian/opensm-boot.init
===================================================================
--- opensm/trunk/debian/opensm-boot.init (rev 0)
+++ opensm/trunk/debian/opensm-boot.init 2009-03-18 16:58:57 UTC (rev 221)
@@ -0,0 +1,84 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides: opensm
+# Required-Start: $syslog
+# Required-Stop: $syslog
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: Start opensm subnet manager.
+# Description: Enable opensm subnet manage.
+### END INIT INFO
+
+PORTS=""
+[ -f /etc/default/opensm ] && . /etc/default/opensm
+
+[ -x /usr/sbin/opensm ] || exit 0
+
+if [ ! -f /sys/class/infiniband_mad/abi_version ] ; then
+echo "No infiniband adapters found."
+exit 0
+fi
+
+
+start () {
+
+if [ "$PORTS" = "ALL" ]; then
+PORTS=`/usr/sbin/ibstat -p`
+fi
+
+if [ "$PORTS" = "NONE" ]; then
+echo "opensm disabled."
+exit 0
+fi
+
+for PORT in $PORTS ; do
+ echo -n "Starting opensm on $PORT: "
+ start-stop-daemon --start --quiet --make-pidfile --pidfile /var/run/opensm-$PORT --background --exec /usr/sbin/opensm -- -g $PORT -f /var/log/opensm.$PORT.log
+ RETVAL=$?
+ echo
+done
+}
+
+stop () {
+
+if [ "$PORTS" = "ALL" ]; then
+PORTS=`/usr/sbin/ibstat -p`
+fi
+
+if [ "$PORTS" = "NONE" ]; then
+ echo "opensm disabled."
+ exit 0
+fi
+for PORT in $PORTS ; do
+ echo -n "Shutting down opensm: "
+ start-stop-daemon --stop --pidfile /var/run/opensm-$PORT
+ RETVAL=$?
+ echo
+done
+}
+
+
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ restart | force-reload )
+ stop
+ start
+ ;;
+ reload)
+ echo "Reloading opensm configuration..."
+ killall -HUP opensm
+ RETVAL=$?
+ echo "done"
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|restart|reload|force-reload}"
+ RETVAL=1
+ ;;
+esac
+
+exit $RETVAL;
Added: opensm/trunk/debian/opensm.postinst
===================================================================
--- opensm/trunk/debian/opensm.postinst (rev 0)
+++ opensm/trunk/debian/opensm.postinst 2009-03-18 16:58:57 UTC (rev 221)
@@ -0,0 +1,8 @@
+#!/bin/sh -e
+. /usr/share/debconf/confmodule
+
+if [ -x "/etc/init.d/opensm-boot" ]; then
+update-rc.d opensm-boot start 24 S .
+fi
+
+#DEBHELPER#
Added: opensm/trunk/debian/opensm.postrm
===================================================================
--- opensm/trunk/debian/opensm.postrm (rev 0)
+++ opensm/trunk/debian/opensm.postrm 2009-03-18 16:58:57 UTC (rev 221)
@@ -0,0 +1,7 @@
+#!/bin/sh -e
+
+if [ "$1" = "purge" ] ; then
+ update-rc.d opensm-boot remove >/dev/null || exit $?
+fi
+
+#DEBHELPER#
Modified: opensm/trunk/debian/rules
===================================================================
--- opensm/trunk/debian/rules 2009-03-15 09:57:09 UTC (rev 220)
+++ opensm/trunk/debian/rules 2009-03-18 16:58:57 UTC (rev 221)
@@ -64,6 +64,7 @@
# Add here commands to install the package into debian/opensm.
$(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
+ cp $(CURDIR)/debian/opensm-boot.init $(CURDIR)/debian/tmp/etc/init.d/opensm-boot
# Build architecture-independent files here.
More information about the Pkg-ofed-commits
mailing list