lkml.org 
[lkml]   [2002]   [Jul]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectInit Skript / RPM für SuSE & RedHat
From
Date
Das hier ist sicherlich keine endgültige Lösung, aber es zeigt
im Prinzip, wie man die Distributions-Unterschiede im init.d Skript bzw.
SPEC-file abfangen kann.

--
Martin Wilck Phone: +49 5251 8 15113
Fujitsu Siemens Computers Fax: +49 5251 8 20409
Heinz-Nixdorf-Ring 1 mailto:Martin.Wilck@Fujitsu-Siemens.com
D-33106 Paderborn http://www.fujitsu-siemens.com/primergy




Summary: SNMP daemon for monitoring the Promise FastTrak RAID controller
Name: ftrksnmp
Version: 1.31.0064
Release: 4fsc
URL: http://www.promise.com
Source0: %{name}-%{version}.tar.gz
License: Commercial
Group: System Environment/Daemons
Vendor: Promise Technology
Packager: Fujitsu Siemens Computers
BuildRoot: %{_tmppath}/%{name}-root

%description
This SNMP agent can be used in connection with an SNMP daemon
(ucd-snmp or the Fujitsu Siemens Servermanagement SNMP package)
for remote monitoring and control of the operation of the Promise
FastTrak (TM) IDE RAID controllers.

It requires the Promise FastTrak (TM) driver version 1.2.0 build 15
to be installed for proper operation.

%prep
%setup -q

%build

%install
rm -rf $RPM_BUILD_ROOT
install -d -m 755 $RPM_BUILD_ROOT/{/etc/rc.d/init.d,/usr/sbin,/usr/share/snmp/mibs,/var/adm/fillup-templates}
install -m 644 FASTTRAK-MIB.txt $RPM_BUILD_ROOT/usr/share/snmp/mibs
install -m 755 ftsnmpd $RPM_BUILD_ROOT/usr/sbin
install -m 755 ftstart $RPM_BUILD_ROOT/etc/rc.d/init.d
install -m 644 rc.config.ftsnmpd $RPM_BUILD_ROOT/var/adm/fillup-templates

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root)
%dir /etc/rc.d/init.d
%dir /usr/share/snmp/mibs
%dir /var/adm/fillup-templates
/usr/share/snmp/mibs/FASTTRAK-MIB.txt
/usr/sbin/ftsnmpd
/var/adm/fillup-templates/rc.config.ftsnmpd
%config /etc/rc.d/init.d/ftstart
%doc README

%post
if [ -f /etc/rc.d/init.d/functions ]; then
[ -x /sbin/chkconfig ] && /sbin/chkconfig --add ftstart
elif [ -f /etc/rc.config ]; then
ln -s ../rc.d/init.d/ftstart /etc/init.d/ftstart
[ -x sbin/insserv ] && sbin/insserv /etc/init.d/ftstart
[ -x bin/fillup ] && bin/fillup -q etc/rc.config var/adm/fillup-templates/rc.config.ftsnmpd
fi
exit 0

%preun
/etc/rc.d/init.d/ftstart stop
exit 0

%postun
if [ -f /etc/rc.d/init.d/functions ]; then
[ -x /sbin/chkconfig ] && /sbin/chkconfig --del ftstart
elif [ -f /etc/rc.config ]; then
rm -f /etc/init.d/ftstart
[ -x sbin/insserv ] && sbin/insserv /etc/init.d
fi
exit 0


%changelog
* Fri Jul 5 2002 Martin Wilck <martin.wilck@fujitsu-siemens.com>
- Initial build.


#!/bin/sh
#
# chkconfig: 345 95 40
#
# description: SNMP daemon for the FastTrak product line
#
# processname: ftsnmpd
# Source function library.

### BEGIN INIT INFO
# Provides:
# Required-Start: snmp
# Required-Stop:
# Default-Start: 3 4 5
# Default-Stop: 0 1 2 6
# Description: SNMP daemon for the FastTrak product line
### END INIT INFO

FTSNMPD=/usr/sbin/ftsnmpd

killproc_rh () {
local proc=$1
local sig=$2
killproc $proc $sig
}

killproc_suse () {
local proc=$1
local sig=$2
killproc $sig $proc
}

if [ -f /etc/rc.d/init.d/functions ]; then
# RedHat
. /etc/rc.d/init.d/functions
START=daemon
STOP=killproc_rh
STATUS=status $FTSNMPD
elif [ -f /etc/rc.config ]; then
# SusE
. /etc/rc.config
[ "x$START_FTSNMPD" = "xyes" ] || exit 0
. /etc/rc.status
START=startproc
STOP=killproc_suse
STATUS="rc_status -v"
else
echo "Cannot determine distribution" >&2
exit 1
fi

# See how we were called.
case "$1" in
start)
echo -n "Starting ftsnmpd: "
$START $FTSNMPD
$STATUS
;;
stop)
echo -n "Stopping ftsnmpd: "
$STOP $FTSNMPD "-15"
$STATUS
;;
status)
$STATUS
;;
restart|reload)
$0 stop
$0 start
;;

*)
exit 1
esac
\
 
 \ /
  Last update: 2005-03-22 13:22    [W:0.049 / U:6.524 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site