As result of previous patch, there is inconsistency in naming of init script, daemon and lock file. I propose to remove the freeipmi- prefix from all these file names.
If you are concerned about conflicts in /etc/init.d/ directory, I can assure you there is no other ipmieventd or bmc-watchdog service. In addition, if there were one, it would probably conflict in /usr/bin/ipmidetectd and /usr/bin/bpm_watchdog. There is no policy in LSB, how the initscript and their lockfiles should be named, it's just common practice to have the same daemon name, initscript name and lockfile. Of course, I could modify only the Makefile.am to rename the files during installation, if you prefer no renaming in CVS. Signed-off-by: Jan Safranek <[email protected]> --- bmc-watchdog/Makefile.am | 14 +-- bmc-watchdog/bmc-watchdog.init | 127 ++++++++++++++++++++++++++ bmc-watchdog/bmc-watchdog.logrotate | 16 +++ bmc-watchdog/bmc-watchdog.sysconfig | 44 +++++++++ bmc-watchdog/freeipmi-bmc-watchdog.init | 128 -------------------------- bmc-watchdog/freeipmi-bmc-watchdog.logrotate | 16 --- bmc-watchdog/freeipmi-bmc-watchdog.sysconfig | 44 --------- freeipmi.spec.in | 61 ++++++------ ipmidetect/Makefile.am | 6 + ipmidetect/freeipmi-ipmidetectd.init | 112 ----------------------- ipmidetect/ipmidetectd.init | 112 +++++++++++++++++++++++ 11 files changed, 340 insertions(+), 340 deletions(-) create mode 100644 bmc-watchdog/bmc-watchdog.init create mode 100644 bmc-watchdog/bmc-watchdog.logrotate create mode 100644 bmc-watchdog/bmc-watchdog.sysconfig delete mode 100755 bmc-watchdog/freeipmi-bmc-watchdog.init delete mode 100644 bmc-watchdog/freeipmi-bmc-watchdog.logrotate delete mode 100644 bmc-watchdog/freeipmi-bmc-watchdog.sysconfig delete mode 100644 ipmidetect/freeipmi-ipmidetectd.init create mode 100644 ipmidetect/ipmidetectd.init diff --git a/bmc-watchdog/Makefile.am b/bmc-watchdog/Makefile.am index 5067f6e..08fee08 100644 --- a/bmc-watchdog/Makefile.am +++ b/bmc-watchdog/Makefile.am @@ -17,25 +17,25 @@ DISTCLEANFILES = $(MANS_CPP) $(MANS_CPP:%=%.pre) .deps/*.P BMCWATCHDOGLOGdir = $(localstatedir)/log/$(PACKAGE) -EXTRA_DIST = freeipmi-bmc-watchdog.init freeipmi-bmc-watchdog.logrotate freeipmi-bmc-watchdog.sysconfig +EXTRA_DIST = bmc-watchdog.init bmc-watchdog.logrotate bmc-watchdog.sysconfig install-data-local: $(INSTALL_INIT_SCRIPTS) $(INSTALL_LOGROTATE_CONFIG) \ $(INSTALL_LOGDIR) install-init-scripts: $(INSTALL) -m 755 -d $(DESTDIR)$(sysconfdir)/init.d - $(INSTALL) -m 755 $(srcdir)/freeipmi-bmc-watchdog.init $(DESTDIR)$(sysconfdir)/init.d/freeipmi-bmc-watchdog + $(INSTALL) -m 755 $(srcdir)/bmc-watchdog.init $(DESTDIR)$(sysconfdir)/init.d/bmc-watchdog $(INSTALL) -m 755 -d $(DESTDIR)/$(sysconfdir)/sysconfig - $(INSTALL) -m 444 $(srcdir)/freeipmi-bmc-watchdog.sysconfig $(DESTDIR)$(sysconfdir)/sysconfig/freeipmi-bmc-watchdog + $(INSTALL) -m 444 $(srcdir)/bmc-watchdog.sysconfig $(DESTDIR)$(sysconfdir)/sysconfig/bmc-watchdog install-logrotate-config: $(INSTALL) -m 755 -d $(DESTDIR)$(sysconfdir)/logrotate.d - $(INSTALL) -m 444 $(srcdir)/freeipmi-bmc-watchdog.logrotate $(DESTDIR)$(sysconfdir)/logrotate.d/freeipmi-bmc-watchdog + $(INSTALL) -m 444 $(srcdir)/bmc-watchdog.logrotate $(DESTDIR)$(sysconfdir)/logrotate.d/bmc-watchdog install-logdir: $(INSTALL) -m 755 -d $(DESTDIR)$(BMCWATCHDOGLOGdir) uninstall-local: - $(RM) -f $(DESTDIR)$(sysconfdir)/init.d/freeipmi-bmc-watchdog - $(RM) -f $(DESTDIR)$(sysconfdir)/logrotate.d/freeipmi-bmc-watchdog - $(RM) -f $(DESTDIR)$(sysconfdir)/sysconfig/freeipmi-bmc-watchdog + $(RM) -f $(DESTDIR)$(sysconfdir)/init.d/bmc-watchdog + $(RM) -f $(DESTDIR)$(sysconfdir)/logrotate.d/bmc-watchdog + $(RM) -f $(DESTDIR)$(sysconfdir)/sysconfig/bmc-watchdog diff --git a/bmc-watchdog/bmc-watchdog.init b/bmc-watchdog/bmc-watchdog.init new file mode 100644 index 0000000..6be5d7a --- /dev/null +++ b/bmc-watchdog/bmc-watchdog.init @@ -0,0 +1,127 @@ +#!/bin/sh +# +# chkconfig: - 99 01 +# description: bmc-watchdog startup script +# +### BEGIN INIT INFO +# Provides: bmc-watchdog +# Required-Start: $network $remote_fs $syslog +# Required-Stop: $network $remote_fs $syslog +# Default-Stop: 0 1 2 6 +# Short-Description: Start and stop bmc-watchdog +# Description: BMC watchdog timer daemon +### END INIT INFO + +DAEMON=/usr/sbin/bmc-watchdog +LOCKFILE=/var/lock/subsys/bmc-watchdog +CONFFILE=/etc/sysconfig/bmc-watchdog + +[ -f $DAEMON ] || exit 5 + +if [ -r $CONFFILE ]; then + . $CONFFILE +fi + +# Load Redhat or Suse appropriate libs +if [ -f /etc/rc.d/init.d/functions ] ; then + . /etc/rc.d/init.d/functions + Xstart() { + + # Default deamon mode + # + # timer use = SMS/OS + # pre-timeout interrupt = none + # action = reset + # -F, -P, -L, -S, -O - clear flags + # initial-countdown = 900 seconds (15 mins) + # reset-period = 60 seconds + + daemon -20 $DAEMON $OPTIONS + RETVAL=$? + echo + [ $RETVAL -eq 0 ] && touch $LOCKFILE + } + Xstop() { + killproc bmc-watchdog + RETVAL=$? + echo + [ $RETVAL -eq 0 ] && rm -f $LOCKFILE + } + Xstatus() { + status bmc-watchdog + RETVAL=$? + return $RETVAL + } + Xcondrestart() { + if test -e $LOCKFILE; then + $0 stop + $0 start + RETVAL=$? + fi + } + Xexit() { + exit $RETVAL + } +elif [ -f /etc/rc.status ] ; then + . /etc/rc.status + Xstart() { + startproc -20 $DAEMON $OPTIONS + rc_status -v + } + Xstop() { + killproc -TERM $DAEMON + rc_status -v + } + Xstatus() { + echo -n "Checking for bmc-watchdog: " + checkproc $DAEMON + rc_status -v + } + Xcondrestart() { + $0 status + if test $? = 0; then + $0 restart + else + rc_reset + fi + rc_status + } + Xexit() { + rc_exit + } +else + echo "Unknown distribution type" + exit 1 +fi + +RETVAL=0 + +case "$1" in + start) + echo -n "Starting bmc-watchdog: " + Xstatus >/dev/null 2>&1 && exit 0 + Xstart + ;; + + stop) + echo -n "Shutting down bmc-watchdog: " + Xstop + ;; + + restart) + $0 stop + $0 start + RETVAL=$? + ;; + status) + Xstatus + ;; + condrestart|try-restart|force-reload) + Xcondrestart + ;; + *) + echo "Usage: $0 {start|stop|restart|status|condrestart|try-restart|force-reload}" + exit 2 +esac + +exit $RETVAL diff --git a/bmc-watchdog/bmc-watchdog.logrotate b/bmc-watchdog/bmc-watchdog.logrotate new file mode 100644 index 0000000..5de8754 --- /dev/null +++ b/bmc-watchdog/bmc-watchdog.logrotate @@ -0,0 +1,16 @@ +## +# $Id: freeipmi-bmc-watchdog.logrotate,v 1.1 2006/05/15 17:58:42 chu11 Exp $ +## + +/var/log/freeipmi/bmc-watchdog.log { + rotate 21 + daily + compress + missingok + nocreate + nomail + notifempty + postrotate + /etc/init.d/bmc-watchdog condrestart + endscript +} diff --git a/bmc-watchdog/bmc-watchdog.sysconfig b/bmc-watchdog/bmc-watchdog.sysconfig new file mode 100644 index 0000000..4d39cf4 --- /dev/null +++ b/bmc-watchdog/bmc-watchdog.sysconfig @@ -0,0 +1,44 @@ +# +# This configuration file controls the behaviour of the bmc-watchdog daemon +# from FreeIPMI. +# +# -u INT, --timer-use=INT +# Set timer use. The timer use value can be set to one of the +# following: 1 = BIOS FRB2, 2 = BIOS POST, 3 = OS_LOAD, 4 = SMS +# OS, 5 = OEM. +# +# -p INT, --pre-timeout-interrupt=INT +# Set pre-timeout interrupt. The pre timeout interrupt can be set +# to one of the following: 0 = None, 1 = SMI, 2 = NMI, 3 = Messag- +# ing Interrupt. +# +# -a INT, --timeout-action=INT +# Set timeout action. The timeout action can be set to one of the +# following: 0 = No action, 1 = Hard Reset, 2 = Power Down, 3 = +# Power Cycle. +# +# -F, --clear-bios-frb2 +# Clear BIOS FRB2 Timer Use Flag. +# +# -P, --clear-bios-post +# Clear BIOS POST Timer Use Flag. +# +# -L, --clear-os-load +# Clear OS Load Timer Use Flag. +# +# -S, --clear-sms-os +# Clear SMS/OS Timer Use Flag. +# +# -O, --clear-oem +# Clear OEM Timer Use Flag. +# +# -i SECS, --initial-countdown=SECS +# Set initial countdown in seconds. +# +# -e, --reset-period +# Time interval to wait before resetting timer. The default is 60 +# seconds. +# +# For the remaining options, consult man bmc-watchdog +# +OPTIONS="-d -u 4 -p 0 -a 1 -F -P -L -S -O -i 900 -e 60" diff --git a/bmc-watchdog/freeipmi-bmc-watchdog.init b/bmc-watchdog/freeipmi-bmc-watchdog.init deleted file mode 100755 index b49416c..0000000 --- a/bmc-watchdog/freeipmi-bmc-watchdog.init +++ /dev/null @@ -1,128 +0,0 @@ -#!/bin/sh -# -# chkconfig: - 99 01 -# description: bmc-watchdog startup script -# -### BEGIN INIT INFO -# Provides: bmc-watchdog -# Required-Start: $network $remote_fs $syslog -# Required-Stop: $network $remote_fs $syslog -# Default-Stop: 0 1 2 6 -# Short-Description: Start and stop bmc-watchdog -# Description: BMC watchdog timer daemon -### END INIT INFO - -DAEMON=/usr/sbin/bmc-watchdog -PIDFILE=/var/run/freeipmi-bmc-watchdog.pid -LOCKFILE=/var/lock/subsys/bmc-watchdog -CONFFILE=/etc/sysconfig/freeipmi-bmc-watchdog - -[ -f $DAEMON ] || exit 5 - -if [ -r $CONFFILE ]; then - . $CONFFILE -fi - -# Load Redhat or Suse appropriate libs -if [ -f /etc/rc.d/init.d/functions ] ; then - . /etc/rc.d/init.d/functions - Xstart() { - - # Default deamon mode - # - # timer use = SMS/OS - # pre-timeout interrupt = none - # action = reset - # -F, -P, -L, -S, -O - clear flags - # initial-countdown = 900 seconds (15 mins) - # reset-period = 60 seconds - - daemon -20 $DAEMON $OPTIONS - RETVAL=$? - echo - [ $RETVAL -eq 0 ] && touch $LOCKFILE - } - Xstop() { - killproc bmc-watchdog - RETVAL=$? - echo - [ $RETVAL -eq 0 ] && rm -f $LOCKFILE - } - Xstatus() { - status bmc-watchdog - RETVAL=$? - return $RETVAL - } - Xcondrestart() { - if test -e $LOCKFILE; then - $0 stop - $0 start - RETVAL=$? - fi - } - Xexit() { - exit $RETVAL - } -elif [ -f /etc/rc.status ] ; then - . /etc/rc.status - Xstart() { - startproc -20 $DAEMON $OPTIONS - rc_status -v - } - Xstop() { - killproc -TERM $DAEMON - rc_status -v - } - Xstatus() { - echo -n "Checking for bmc-watchdog: " - checkproc $DAEMON - rc_status -v - } - Xcondrestart() { - $0 status - if test $? = 0; then - $0 restart - else - rc_reset - fi - rc_status - } - Xexit() { - rc_exit - } -else - echo "Unknown distribution type" - exit 1 -fi - -RETVAL=0 - -case "$1" in - start) - echo -n "Starting bmc-watchdog: " - Xstatus >/dev/null 2>&1 && exit 0 - Xstart - ;; - - stop) - echo -n "Shutting down bmc-watchdog: " - Xstop - ;; - - restart) - $0 stop - $0 start - RETVAL=$? - ;; - status) - Xstatus - ;; - condrestart|try-restart|force-reload) - Xcondrestart - ;; - *) - echo "Usage: $0 {start|stop|restart|status|condrestart|try-restart|force-reload}" - exit 2 -esac - -exit $RETVAL diff --git a/bmc-watchdog/freeipmi-bmc-watchdog.logrotate b/bmc-watchdog/freeipmi-bmc-watchdog.logrotate deleted file mode 100644 index a367e17..0000000 --- a/bmc-watchdog/freeipmi-bmc-watchdog.logrotate +++ /dev/null @@ -1,16 +0,0 @@ -## -# $Id: freeipmi-bmc-watchdog.logrotate,v 1.1 2006/05/15 17:58:42 chu11 Exp $ -## - -/var/log/freeipmi/bmc-watchdog.log { - rotate 21 - daily - compress - missingok - nocreate - nomail - notifempty - postrotate - /etc/init.d/freeipmi-bmc-watchdog condrestart - endscript -} diff --git a/bmc-watchdog/freeipmi-bmc-watchdog.sysconfig b/bmc-watchdog/freeipmi-bmc-watchdog.sysconfig deleted file mode 100644 index 4d39cf4..0000000 --- a/bmc-watchdog/freeipmi-bmc-watchdog.sysconfig +++ /dev/null @@ -1,44 +0,0 @@ -# -# This configuration file controls the behaviour of the bmc-watchdog daemon -# from FreeIPMI. -# -# -u INT, --timer-use=INT -# Set timer use. The timer use value can be set to one of the -# following: 1 = BIOS FRB2, 2 = BIOS POST, 3 = OS_LOAD, 4 = SMS -# OS, 5 = OEM. -# -# -p INT, --pre-timeout-interrupt=INT -# Set pre-timeout interrupt. The pre timeout interrupt can be set -# to one of the following: 0 = None, 1 = SMI, 2 = NMI, 3 = Messag- -# ing Interrupt. -# -# -a INT, --timeout-action=INT -# Set timeout action. The timeout action can be set to one of the -# following: 0 = No action, 1 = Hard Reset, 2 = Power Down, 3 = -# Power Cycle. -# -# -F, --clear-bios-frb2 -# Clear BIOS FRB2 Timer Use Flag. -# -# -P, --clear-bios-post -# Clear BIOS POST Timer Use Flag. -# -# -L, --clear-os-load -# Clear OS Load Timer Use Flag. -# -# -S, --clear-sms-os -# Clear SMS/OS Timer Use Flag. -# -# -O, --clear-oem -# Clear OEM Timer Use Flag. -# -# -i SECS, --initial-countdown=SECS -# Set initial countdown in seconds. -# -# -e, --reset-period -# Time interval to wait before resetting timer. The default is 60 -# seconds. -# -# For the remaining options, consult man bmc-watchdog -# -OPTIONS="-d -u 4 -p 0 -a 1 -F -P -L -S -O -i 900 -e 60" diff --git a/freeipmi.spec.in b/freeipmi.spec.in index d30e449..2f7de99 100644 --- a/freeipmi.spec.in +++ b/freeipmi.spec.in @@ -66,8 +66,8 @@ IPMI node detection daemon. %build %configure --program-prefix=%{?_program_prefix:%{_program_prefix}} \ - %{?_enable_debug} --disable-static -CFLAGS="$RPM_OPT_FLAGS" make %{?_smp_mflags} + %{?_enable_debug} --disable-static CFLAGS="$RPM_OPT_FLAGS -DINT_MAX=65536" +make %{?_smp_mflags} %install rm -rf $RPM_BUILD_ROOT @@ -78,8 +78,8 @@ mkdir -p $RPM_BUILD_ROOT/%{_initrddir}/ # if check needed for SLES systems if [[ "%{_sysconfdir}/init.d" != "%{_initrddir}" ]] then -mv $RPM_BUILD_ROOT/%{_sysconfdir}/init.d/freeipmi-bmc-watchdog $RPM_BUILD_ROOT/%{_initrddir}/freeipmi-bmc-watchdog -mv $RPM_BUILD_ROOT/%{_sysconfdir}/init.d/freeipmi-ipmidetectd $RPM_BUILD_ROOT/%{_initrddir}/freeipmi-ipmidetectd +mv $RPM_BUILD_ROOT/%{_sysconfdir}/init.d/bmc-watchdog $RPM_BUILD_ROOT/%{_initrddir}/bmc-watchdog +mv $RPM_BUILD_ROOT/%{_sysconfdir}/init.d/ipmidetectd $RPM_BUILD_ROOT/%{_initrddir}/ipmidetectd fi rm -f %{buildroot}%{_infodir}/dir # kludge to get around rpmlint complaining about 0 length semephore file @@ -109,17 +109,17 @@ fi %post bmc-watchdog if [ "$1" = 1 ]; then - if [ -x %{_initrddir}/freeipmi-bmc-watchdog ]; then - /sbin/chkconfig --add freeipmi-bmc-watchdog - /sbin/chkconfig freeipmi-bmc-watchdog off + if [ -x %{_initrddir}/bmc-watchdog ]; then + /sbin/chkconfig --add bmc-watchdog + /sbin/chkconfig bmc-watchdog off fi fi if [ $1 -ge 1 ]; then - if [ -x %{_initrddir}/freeipmi-bmc-watchdog ]; then - if %{_initrddir}/freeipmi-bmc-watchdog status | grep -q running; then - %{_initrddir}/freeipmi-bmc-watchdog restart + if [ -x %{_initrddir}/bmc-watchdog ]; then + if %{_initrddir}/bmc-watchdog status | grep -q running; then + %{_initrddir}/bmc-watchdog restart else - %{_initrddir}/freeipmi-bmc-watchdog condrestart + %{_initrddir}/bmc-watchdog condrestart fi fi fi @@ -129,27 +129,27 @@ fi # Stop bmc-watchdog if it is running # if [ "$1" = 0 ]; then - if [ -x %{_initrddir}/freeipmi-bmc-watchdog ]; then - if %{_initrddir}/freeipmi-bmc-watchdog status | grep -q running; then - %{_initrddir}/freeipmi-bmc-watchdog stop + if [ -x %{_initrddir}/bmc-watchdog ]; then + if %{_initrddir}/bmc-watchdog status | grep -q running; then + %{_initrddir}/bmc-watchdog stop fi - /sbin/chkconfig --del freeipmi-bmc-watchdog + /sbin/chkconfig --del bmc-watchdog fi fi %post ipmidetectd if [ "$1" = 1 ]; then - if [ -x %{_initrddir}/freeipmi-ipmidetectd ]; then - /sbin/chkconfig --add freeipmi-ipmidetectd - /sbin/chkconfig freeipmi-ipmidetectd off + if [ -x %{_initrddir}/ipmidetectd ]; then + /sbin/chkconfig --add ipmidetectd + /sbin/chkconfig ipmidetectd off fi fi if [ $1 -ge 1 ]; then - if [ -x %{_initrddir}/freeipmi-ipmidetectd ]; then - if %{_initrddir}/freeipmi-ipmidetectd status | grep -q running; then - %{_initrddir}/freeipmi-ipmidetectd restart + if [ -x %{_initrddir}/ipmidetectd ]; then + if %{_initrddir}/ipmidetectd status | grep -q running; then + %{_initrddir}/ipmidetectd restart else - %{_initrddir}/freeipmi-ipmidetectd condrestart + %{_initrddir}/ipmidetectd condrestart fi fi fi @@ -159,11 +159,11 @@ fi # Stop ipmidetectd if it is running # if [ "$1" = 0 ]; then - if [ -x %{_initrddir}/freeipmi-ipmidetectd ]; then - if %{_initrddir}/freeipmi-ipmidetectd status | grep -q running; then - %{_initrddir}/freeipmi-ipmidetectd stop + if [ -x %{_initrddir}/ipmidetectd ]; then + if %{_initrddir}/ipmidetectd status | grep -q running; then + %{_initrddir}/ipmidetectd stop fi - /sbin/chkconfig --del freeipmi-ipmidetectd + /sbin/chkconfig --del ipmidetectd fi fi @@ -327,16 +327,17 @@ fi %doc %{_datadir}/doc/%{name}/COPYING.bmc-watchdog %doc %{_datadir}/doc/%{name}/DISCLAIMER.bmc-watchdog %doc %{_datadir}/doc/%{name}/DISCLAIMER.bmc-watchdog.UC -%config(noreplace) %{_initrddir}/freeipmi-bmc-watchdog -%config(noreplace) %{_sysconfdir}/sysconfig/freeipmi-bmc-watchdog -%config(noreplace) %{_sysconfdir}/logrotate.d/freeipmi-bmc-watchdog +%config(noreplace) %{_initrddir}/bmc-watchdog +%config(noreplace) %{_sysconfdir}/sysconfig/bmc-watchdog +%config(noreplace) %{_sysconfdir}/logrotate.d/bmc-watchdog %{_sbindir}/bmc-watchdog %{_mandir}/man8/bmc-watchdog.8* %dir %{_localstatedir}/log/freeipmi %files ipmidetectd %defattr(-,root,root) -%config(noreplace) %{_initrddir}/freeipmi-ipmidetectd +%config(noreplace) %{_initrddir}/ipmidetectd +%config(noreplace) %{_sysconfdir}//ipmidetectd.conf %{_sbindir}/ipmidetectd %{_mandir}/man5/ipmidetectd.conf.5* %{_mandir}/man8/ipmidetectd.8* diff --git a/ipmidetect/Makefile.am b/ipmidetect/Makefile.am index b265564..f2bd8b3 100644 --- a/ipmidetect/Makefile.am +++ b/ipmidetect/Makefile.am @@ -16,16 +16,16 @@ CLEANFILES = $(MANS_CPP) *~ DISTCLEANFILES = $(MANS_CPP) $(MANS_CPP:%=%.pre) .deps/*.P -EXTRA_DIST = freeipmi-ipmidetectd.init ipmidetectd.conf +EXTRA_DIST = ipmidetectd.init ipmidetectd.conf install-data-local: $(INSTALL_INIT_SCRIPTS) $(INSTALL) -m 644 $(srcdir)/ipmidetectd.conf $(DESTDIR)$(sysconfdir)/ipmidetectd.conf install-init-scripts: $(INSTALL) -m 755 -d $(DESTDIR)$(sysconfdir)/init.d - $(INSTALL) -m 755 $(srcdir)/freeipmi-ipmidetectd.init $(DESTDIR)$(sysconfdir)/init.d/freeipmi-ipmidetectd + $(INSTALL) -m 755 $(srcdir)/ipmidetectd.init $(DESTDIR)$(sysconfdir)/init.d/ipmidetectd uninstall-local: - $(RM) -f $(DESTDIR)$(sysconfdir)/init.d/freeipmi-ipmidetectd + $(RM) -f $(DESTDIR)$(sysconfdir)/init.d/ipmidetectd $(RM) -f $(DESTDIR)$(sysconfdir)/ipmidetectd.conf diff --git a/ipmidetect/freeipmi-ipmidetectd.init b/ipmidetect/freeipmi-ipmidetectd.init deleted file mode 100644 index e5521b4..0000000 --- a/ipmidetect/freeipmi-ipmidetectd.init +++ /dev/null @@ -1,112 +0,0 @@ -#!/bin/sh -# $Id: freeipmi-ipmidetectd.init,v 1.3 2007/12/14 19:16:25 chu11 Exp $ -# -# chkconfig: - 70 40 -# description: ipmidetectd startup script -# -### BEGIN INIT INFO -# Provides: ipmidetectd -# Required-Start: $network $remote_fs $syslog -# Required-Stop: $network $remote_fs $syslog -# Default-Stop: 0 1 2 6 -# Short-Description: Start and stop ipmidetectd -# Description: IPMI node detection monitoring daemon -### END INIT INFO - -IPMIDETECTD=/usr/sbin/ipmidetectd -IPMIDETECTD_CONF=/etc/ipmidetectd.conf -LOCKFILE=//var/lock/subsys/ipmidetectd - -[ -f $IPMIDETECTD ] || exit 5 -[ -f $IPMIDETECTD_CONF ] || exit 6 - -# Load Redhat or Suse appropriate libs -if [ -f /etc/rc.d/init.d/functions ] ; then - . /etc/rc.d/init.d/functions - Xstart() { - daemon $IPMIDETECTD - RETVAL=$? - echo - [ $RETVAL -eq 0 ] && touch $LOCKFILE - } - Xstop() { - killproc ipmidetectd -TERM - RETVAL=$? - echo - [ $RETVAL -eq 0 ] && rm -f $LOCKFILE - } - Xstatus() { - status ipmidetectd - RETVAL=$? - return $RETVAL - } - Xcondrestart() { - if test -e $LOCKFILE; then - $0 stop - $0 start - RETVAL=$? - fi - } - Xexit() { - exit $RETVAL - } -elif [ -f /etc/rc.status ] ; then - . /etc/rc.status - Xstart() { - startproc $IPMIDETECTD - rc_status -v - } - Xstop() { - killproc -TERM $IPMIDETECTD - rc_status -v - } - Xstatus() { - echo -n "Checking for ipmidetectd: " - checkproc $IPMIDETECTD - rc_status -v - } - Xcondrestart() { - $0 status - if test $? = 0; then - $0 restart - else - rc_reset - fi - rc_status - } - Xexit() { - rc_exit - } -else - echo "Unknown distribution type" - exit 1 -fi - -RETVAL=0 - -case "$1" in - start) - echo -n "Starting ipmidetectd: " - Xstatus >/dev/null 2>&1 && exit 0 - Xstart - ;; - stop) - echo -n "Shutting down ipmidetectd: " - Xstop - ;; - restart) - $0 stop - $0 start - RETVAL=$? - ;; - status) - Xstatus - ;; - condrestart|try-restart|force-reload) - Xcondrestart - ;; - *) - echo "Usage: $0 {start|stop|restart|status|condrestart|try-restart|force-reload}" - exit 2 -esac -exit $RETVAL diff --git a/ipmidetect/ipmidetectd.init b/ipmidetect/ipmidetectd.init new file mode 100644 index 0000000..e5521b4 --- /dev/null +++ b/ipmidetect/ipmidetectd.init @@ -0,0 +1,112 @@ +#!/bin/sh +# $Id: freeipmi-ipmidetectd.init,v 1.3 2007/12/14 19:16:25 chu11 Exp $ +# +# chkconfig: - 70 40 +# description: ipmidetectd startup script +# +### BEGIN INIT INFO +# Provides: ipmidetectd +# Required-Start: $network $remote_fs $syslog +# Required-Stop: $network $remote_fs $syslog +# Default-Stop: 0 1 2 6 +# Short-Description: Start and stop ipmidetectd +# Description: IPMI node detection monitoring daemon +### END INIT INFO + +IPMIDETECTD=/usr/sbin/ipmidetectd +IPMIDETECTD_CONF=/etc/ipmidetectd.conf +LOCKFILE=//var/lock/subsys/ipmidetectd + +[ -f $IPMIDETECTD ] || exit 5 +[ -f $IPMIDETECTD_CONF ] || exit 6 + +# Load Redhat or Suse appropriate libs +if [ -f /etc/rc.d/init.d/functions ] ; then + . /etc/rc.d/init.d/functions + Xstart() { + daemon $IPMIDETECTD + RETVAL=$? + echo + [ $RETVAL -eq 0 ] && touch $LOCKFILE + } + Xstop() { + killproc ipmidetectd -TERM + RETVAL=$? + echo + [ $RETVAL -eq 0 ] && rm -f $LOCKFILE + } + Xstatus() { + status ipmidetectd + RETVAL=$? + return $RETVAL + } + Xcondrestart() { + if test -e $LOCKFILE; then + $0 stop + $0 start + RETVAL=$? + fi + } + Xexit() { + exit $RETVAL + } +elif [ -f /etc/rc.status ] ; then + . /etc/rc.status + Xstart() { + startproc $IPMIDETECTD + rc_status -v + } + Xstop() { + killproc -TERM $IPMIDETECTD + rc_status -v + } + Xstatus() { + echo -n "Checking for ipmidetectd: " + checkproc $IPMIDETECTD + rc_status -v + } + Xcondrestart() { + $0 status + if test $? = 0; then + $0 restart + else + rc_reset + fi + rc_status + } + Xexit() { + rc_exit + } +else + echo "Unknown distribution type" + exit 1 +fi + +RETVAL=0 + +case "$1" in + start) + echo -n "Starting ipmidetectd: " + Xstatus >/dev/null 2>&1 && exit 0 + Xstart + ;; + stop) + echo -n "Shutting down ipmidetectd: " + Xstop + ;; + restart) + $0 stop + $0 start + RETVAL=$? + ;; + status) + Xstatus + ;; + condrestart|try-restart|force-reload) + Xcondrestart + ;; + *) + echo "Usage: $0 {start|stop|restart|status|condrestart|try-restart|force-reload}" + exit 2 +esac +exit $RETVAL _______________________________________________ Freeipmi-devel mailing list [email protected] http://lists.gnu.org/mailman/listinfo/freeipmi-devel
