From: Martin Wilck <Martin.Wilck@Fujitsu-Siemens.com>
To: Linux Kernel mailing list <linux-kernel@vger.kernel.org>
Subject: Init Skript / RPM für SuSE & RedHat
Date: 05 Jul 2002 14:46:47 +0200 [thread overview]
Message-ID: <1025873207.30422.29.camel@biker.pdb.fsc.net> (raw)
[-- Attachment #1: Type: text/plain, Size: 420 bytes --]
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
[-- Attachment #2: Specfile --]
[-- Type: text/plain, Size: 2201 bytes --]
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.
[-- Attachment #3: Init skript --]
[-- Type: text/x-sh, Size: 1305 bytes --]
#!/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
next reply other threads:[~2002-07-05 12:43 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-07-05 12:46 Martin Wilck [this message]
2002-07-05 12:57 ` Roy Sigurd Karlsbakk
2002-07-05 20:43 ` Andre Hedrick
2002-07-08 7:12 ` Martin Wilck
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1025873207.30422.29.camel@biker.pdb.fsc.net \
--to=martin.wilck@fujitsu-siemens.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®