diff options
-rw-r--r-- | debian/dirs | 1 | ||||
-rwxr-xr-x | debian/ipmiutuil.ipmi_port.init | 187 | ||||
-rw-r--r-- | debian/patches/003-typo-man.patch | 4 | ||||
-rw-r--r-- | debian/patches/005-init.patch | 183 | ||||
-rwxr-xr-x | debian/rules | 11 |
5 files changed, 361 insertions, 25 deletions
diff --git a/debian/dirs b/debian/dirs deleted file mode 100644 index 9b64c52..0000000 --- a/debian/dirs +++ /dev/null @@ -1 +0,0 @@ -#usr/share/ipmiutil diff --git a/debian/ipmiutuil.ipmi_port.init b/debian/ipmiutuil.ipmi_port.init new file mode 100755 index 0000000..85539ea --- /dev/null +++ b/debian/ipmiutuil.ipmi_port.init @@ -0,0 +1,187 @@ +#! /bin/sh +# +# ipmi_port +# +# chkconfig: 345 91 07 +# description: ipmi_port reserves the IPMI RMCP port 623 from portmap +# which prevents portmap from trying to use port 623. +# This script also applies any saved IPMI thresholds, and +# copies the bmclanpet.mib to where SNMP can find it. +# It is recommended that this service be started for +# all systems with ipmiutil that also have portmap. +# +### BEGIN INIT INFO +# Provides: ipmi_port +# Required-Start: $local_fs $network $remote_fs +# Required-Stop: $local_fs $network $remote_fs +# Default-Start: 3 4 5 3 4 5 +# Default-Stop: 0 1 2 6 0 1 2 6 +# Short-Description: ipmi_port reserves the RMCP port from portmap +# Description: ipmi_port is used to reserve the RMCP port from portmap +### END INIT INFO +# +#if [ -f /etc/init.d/functions ]; then +# Source function library. +#. /etc/init.d/functions +#fi + +name=ipmi_port +progdir=/usr/sbin +prog="$progdir/$name" +lockfile=/var/lock/subsys/$name +portmap=/etc/init.d/portmap +shardir=/usr/share +mibdir=$shardir/snmp/mibs +datadir=$shardir/ipmiutil +vardir=/var/lib/ipmiutil +ifout=${vardir}/ipmi_if.txt +sensorout=${vardir}/sensor_out.txt +threshout=${vardir}/thresh_out.txt +# This threshold script could be created by ipmiutil sensor -p ... +thresh="${vardir}/thresholds.sh" + +getpid () { + # This is messy if the parent script is same name as $1 + p=`ps -ef |grep "$1" |grep -v grep |awk '{print $2}'` + echo $p +} + +start() +{ + echo -n $"Starting $name: " + echo + retval=1 + PID=0 + + mkdir -p $vardir + # if [ ! -f $ifout ]; then + # ${datadir}/ipmi_if.sh + # fi + if [ ! -f $sensorout ]; then + # Capture a snapshot of IPMI sensor data for later reuse. + ipmiutil sensor -q >$sensorout + fi + if [ -f $thresh ] + then + # apply saved IPMI sensor thresholds, if any + sh $thresh >$threshout 2>&1 + fi + if [ -d ${mibdir} ] + then + # put bmclanpet MIB where SNMP can find it + cp -f $datadir/bmclanpet.mib ${mibdir}/BMCLAN-PET-MIB.txt + fi + + dpc=`getpid dpcproxy` + if [ "x${dpc}" != "x" ] + then + echo "$name: dpcproxy is already running on port 623," + echo "so $name is not needed." + retval=6 + else + [ -x $portmap ] || exit 6 + [ -x $prog ] || exit 5 + $prog -b + retval=$? + if [ $retval -eq 0 ]; then + PID=`getpid "$prog -b"` + echo $PID >$lockfile + fi + fi + echo + return $retval +} + +stop() +{ + echo -n $"Stopping $name: " + echo + retval=1 + if [ -f $lockfile ]; then + p=`cat $lockfile` + if [ "x$p" = "x" ]; then + p=`getpid "$prog -b"` + fi + if [ "x$p" != "x" ]; then + kill $p + retval=$? + fi + fi + echo + if [ -d ${mibdir} ]; then + rm -f ${mibdir}/BMCLAN-PET-MIB.txt + fi + [ $retval -eq 0 ] && rm -f $lockfile + return $retval +} + +restart() +{ + stop + start +} + +rh_status() { + if [ -f $lockfile ]; then + p=`cat $lockfile` + if [ "x$p" != "x" ]; then + pid=`getpid $p` + if [ "x$pid" != "x" ]; then + echo "$name (pid $pid) is running..." + retval=0 + else + echo "$name is dead but $lockfile exists" + retval=1 + fi + else + echo "$name $lockfile exists but is empty" + retval=2 + fi + else + echo "$name is stopped" + retval=3 + fi + return $retval +} + +rh_status_q() { + rh_status >/dev/null 2>&1 +} + +if [ ! -d /var/lock/subsys ]; then + lockfile=/var/run/$name.pid +fi + +case "$1" in + start) + rh_status_q && exit 0 + start + ;; + stop) + rh_status_q || exit 0 + stop + ;; + status) + rh_status + ;; + restart) + restart + ;; + reload) + rh_status_q || exit 7 + restart + ;; + force_reload) + restart + ;; + condrestart|try-restart) + rh_status_q || exit 0 + restart + ;; + *) + echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}" + exit 2 +esac + +exit $? + diff --git a/debian/patches/003-typo-man.patch b/debian/patches/003-typo-man.patch index 2ada9ff..3dbcf90 100644 --- a/debian/patches/003-typo-man.patch +++ b/debian/patches/003-typo-man.patch @@ -5,8 +5,8 @@ Last-Update: 2014-06-04 This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ Index: trunk/doc/iseltime.8 =================================================================== ---- trunk.orig/doc/iseltime.8 2014-03-31 16:10:19.000000000 +0200 -+++ trunk/doc/iseltime.8 2014-06-29 16:06:29.843381755 +0200 +--- trunk.orig/doc/iseltime.8 2013-07-11 17:08:38.000000000 +0200 ++++ trunk/doc/iseltime.8 2014-08-09 15:06:01.000000000 +0200 @@ -54,7 +54,7 @@ Use a specified IPMI LAN privilege level. 1=Callback level, 2=User level, 3=Operator level, 4=Administrator level (default), 5=OEM level. .IP "-Y" diff --git a/debian/patches/005-init.patch b/debian/patches/005-init.patch index d6131e4..938b511 100644 --- a/debian/patches/005-init.patch +++ b/debian/patches/005-init.patch @@ -5,29 +5,48 @@ Last-Update: 2014-08-09 This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ Index: trunk/scripts/ipmi_port.sh =================================================================== ---- trunk.orig/scripts/ipmi_port.sh 2014-08-09 11:00:23.096102828 +0200 -+++ trunk/scripts/ipmi_port.sh 2014-08-09 11:00:40.716468044 +0200 -@@ -25,6 +25,7 @@ - #. /etc/init.d/functions - #fi - -+ - name=ipmi_port - progdir=/usr/sbin - prog="$progdir/$name" -@@ -46,6 +47,8 @@ - echo $p - } +--- trunk.orig/scripts/ipmi_port.sh 2014-08-10 13:32:43.716552784 +0200 ++++ trunk/scripts/ipmi_port.sh 2014-08-10 13:32:43.292544281 +0200 +@@ -14,8 +14,8 @@ + # Provides: ipmi_port + # Required-Start: $local_fs $network $remote_fs + # Required-Stop: $local_fs $network $remote_fs +-# Default-Start: 3 4 5 3 4 5 +-# Default-Stop: 0 1 2 6 0 1 2 6 ++# Default-Start: 2 3 4 5 ++# Default-Stop: 0 1 6 + # Short-Description: ipmi_port reserves the RMCP port from portmap + # Description: ipmi_port is used to reserve the RMCP port from portmap + ### END INIT INFO +@@ -40,6 +40,8 @@ + # This threshold script could be created by ipmiutil sensor -p ... + thresh="${vardir}/thresholds.sh" +. /lib/lsb/init-functions + - start() - { - echo -n $"Starting $name: " + getpid () { + # This is messy if the parent script is same name as $1 + p=`ps -ef |grep "$1" |grep -v grep |awk '{print $2}'` +@@ -184,4 +186,3 @@ + esac + + exit $? +- Index: trunk/scripts/ipmiutil_asy =================================================================== ---- trunk.orig/scripts/ipmiutil_asy 2014-08-09 11:00:23.096102828 +0200 -+++ trunk/scripts/ipmiutil_asy 2014-08-09 11:00:23.088102663 +0200 +--- trunk.orig/scripts/ipmiutil_asy 2014-08-10 13:32:43.716552784 +0200 ++++ trunk/scripts/ipmiutil_asy 2014-08-10 13:32:43.292544281 +0200 +@@ -13,8 +13,8 @@ + # Provides: ipmiutil_asy + # Required-Start: $local_fs $remote_fs $syslog + # Required-Stop: $local_fs $remote_fs $syslog +-# Default-Start: 3 4 5 3 4 5 +-# Default-Stop: 0 1 2 6 0 1 2 6 ++# Default-Start: 2 3 4 5 ++# Default-Stop: 0 1 6 + # Short-Description: ipmiutil async bridge agent init script + # Description: Init script starts ipmiutil async bridge agent for remote reset + ### END INIT INFO @@ -37,6 +37,8 @@ echo $p } @@ -37,10 +56,26 @@ Index: trunk/scripts/ipmiutil_asy start() { echo -n $"Starting $dname: " +@@ -152,4 +154,3 @@ + exit 2 + esac + exit $? +- Index: trunk/scripts/ipmiutil_wdt =================================================================== ---- trunk.orig/scripts/ipmiutil_wdt 2014-08-09 11:00:23.096102828 +0200 -+++ trunk/scripts/ipmiutil_wdt 2014-08-09 11:00:23.088102663 +0200 +--- trunk.orig/scripts/ipmiutil_wdt 2014-08-10 13:32:43.716552784 +0200 ++++ trunk/scripts/ipmiutil_wdt 2014-08-10 13:32:43.296544361 +0200 +@@ -14,8 +14,8 @@ + # Provides: ipmiutil_wdt + # Required-Start: $local_fs $remote_fs $syslog + # Required-Stop: $local_fs $remote_fs $syslog +-# Default-Start: 3 4 5 3 4 5 +-# Default-Stop: 0 1 2 6 0 1 2 6 ++# Default-Start: 2 3 4 5 ++# Default-Stop: 0 1 6 + # Short-Description: ipmiutil watchdog timer init script + # Description: Init script to enable and reset ipmiutil watchdog timer via cron + ### END INIT INFO @@ -33,6 +33,8 @@ #tmpcron=/tmp/wdtcron.$$ # tmpcron2=/tmp/wdtcron2.$$ @@ -67,8 +102,19 @@ Index: trunk/scripts/ipmiutil_wdt esac Index: trunk/scripts/ipmiutil_evt =================================================================== ---- trunk.orig/scripts/ipmiutil_evt 2014-08-09 11:00:23.096102828 +0200 -+++ trunk/scripts/ipmiutil_evt 2014-08-09 11:00:23.092102746 +0200 +--- trunk.orig/scripts/ipmiutil_evt 2014-08-10 13:32:43.716552784 +0200 ++++ trunk/scripts/ipmiutil_evt 2014-08-10 13:32:43.296544361 +0200 +@@ -15,8 +15,8 @@ + # Provides: ipmiutil_evt + # Required-Start: $local_fs $remote_fs $syslog + # Required-Stop: $local_fs $remote_fs $syslog +-# Default-Start: 3 4 5 3 4 5 +-# Default-Stop: 0 1 2 6 0 1 2 6 ++# Default-Start: 2 3 4 5 ++# Default-Stop: 0 1 6 + # Short-Description: ipmiutil event monitoring init script + # Description: Init script starts ipmiutil event monitoring service + ### END INIT INFO @@ -40,6 +40,8 @@ echo $p } @@ -78,3 +124,96 @@ Index: trunk/scripts/ipmiutil_evt start() { echo -n $"Starting $name: " +@@ -155,4 +157,3 @@ + exit 2 + esac + exit $? +- +Index: trunk/configure.ac +=================================================================== +--- trunk.orig/configure.ac 2014-08-10 13:32:43.716552784 +0200 ++++ trunk/configure.ac 2014-08-10 13:32:43.296544361 +0200 +@@ -326,11 +326,11 @@ + MD2_CFLAGS="-DSKIP_MD2" + init0=/etc/rc.d/init.d + fi +- if test $isredhat -eq 0 ; then ++# if test $isredhat -eq 0 ; then + # set default start/stop for init scripts +- sed -i 's/# Default-Start:/# Default-Start: 3 4 5/' $init_scripts +- sed -i 's/# Default-Stop:/# Default-Stop: 0 1 2 6/' $init_scripts +- fi ++# sed -i 's/# Default-Start:/# Default-Start: 3 4 5/' $init_scripts ++# sed -i 's/# Default-Stop:/# Default-Stop: 0 1 2 6/' $init_scripts ++# fi + if test -f "$LIB_DIR/libcrypto.so"; then + strings $LIB_DIR/libcrypto.so | grep EVP_md2 >/dev/null 2>&1 + if test $? -ne 0; then +Index: trunk/scripts/ipmi_info +=================================================================== +--- trunk.orig/scripts/ipmi_info 2014-08-10 13:32:43.716552784 +0200 ++++ trunk/scripts/ipmi_info 2014-08-10 13:32:43.296544361 +0200 +@@ -11,8 +11,8 @@ + # Provides: ipmi_info + # Required-Start: $local_fs $network $remote_fs + # Required-Stop: $local_fs $network $remote_fs +-# Default-Start: +-# Default-Stop: ++# Default-Start: 2 3 4 5 ++# Default-Stop: 0 1 6 + # Short-Description: ipmi_info saves OS info to the IPMI system info + # Description: ipmi_info saves OS info to the IPMI system info + ### END INIT INFO +@@ -21,6 +21,8 @@ + iuprog=/usr/bin/ipmiutil + tmp=/tmp/ipmi_info.tmp + ++. /lib/lsb/init-functions ++ + getosver() { + if [ -f /etc/os-release ]; then + . /etc/os-release +@@ -121,4 +123,3 @@ + esac + + exit $? +- +Index: trunk/scripts/ipmiutil_asy.service +=================================================================== +--- trunk.orig/scripts/ipmiutil_asy.service 2014-08-10 13:32:43.716552784 +0200 ++++ trunk/scripts/ipmiutil_asy.service 2014-08-10 13:32:43.296544361 +0200 +@@ -11,4 +11,3 @@ + + [Install] + WantedBy=multi-user.target +- +Index: trunk/scripts/ipmiutil_evt.service +=================================================================== +--- trunk.orig/scripts/ipmiutil_evt.service 2014-08-10 13:32:43.716552784 +0200 ++++ trunk/scripts/ipmiutil_evt.service 2014-08-10 13:32:43.296544361 +0200 +@@ -11,5 +11,3 @@ + + [Install] + WantedBy=multi-user.target +- +- +Index: trunk/scripts/ipmiutil_wdt.service +=================================================================== +--- trunk.orig/scripts/ipmiutil_wdt.service 2014-08-10 13:32:43.716552784 +0200 ++++ trunk/scripts/ipmiutil_wdt.service 2014-08-10 13:32:43.708552623 +0200 +@@ -10,5 +10,3 @@ + + [Install] + WantedBy=multi-user.target +- +- +Index: trunk/scripts/ipmi_port.service +=================================================================== +--- trunk.orig/scripts/ipmi_port.service 2013-07-11 17:08:38.000000000 +0200 ++++ trunk/scripts/ipmi_port.service 2014-08-10 13:33:22.773336083 +0200 +@@ -11,5 +11,3 @@ + + [Install] + WantedBy=multi-user.target +- +- diff --git a/debian/rules b/debian/rules index 88a9b40..39e135d 100755 --- a/debian/rules +++ b/debian/rules @@ -24,6 +24,17 @@ override_dh_installman: override_dh_installinit: dh_installinit --name=ipmi_port + dh_installinit --name=ipmi_info dh_installinit --name=ipmiutil_asy dh_installinit --name=ipmiutil_evt dh_installinit --name=ipmiutil_wdt + +# +# remove unwanted files from upstream +# +override_dh_auto_clean: + dh_auto_clean + rm -f $(CURDIR)/debian/files + rm -f $(CURDIR)/debian/dirs + rm -f $(CURDIR)/debian/ipmiutil.lintian-overrides + rm -f $(CURDIR)/debian/ipmiutil.substvars |