diff options
Diffstat (limited to 'sys-infiniband/srptools/files/srpd.initd')
-rw-r--r-- | sys-infiniband/srptools/files/srpd.initd | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/sys-infiniband/srptools/files/srpd.initd b/sys-infiniband/srptools/files/srpd.initd new file mode 100644 index 000000000000..035844a0ee2b --- /dev/null +++ b/sys-infiniband/srptools/files/srpd.initd @@ -0,0 +1,42 @@ +#!/sbin/runscript +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-infiniband/srptools/files/srpd.initd,v 1.1 2012/04/18 16:46:42 alexxy Exp $ + +description="SCSI RDMA Protoaemon daemon" + +depend() { + need net +} + +checkconfig() { + if ! modinfo ib_srp > /dev/null 2>&1 ; then + eerror "ib_srp module not found!" + return 1 + fi +} + +start() { + checkconfig + ebegin "Loading ib_srp module" + modprobe ib_srp + eend $? + ebegin "Starting srp_daemon" + start-stop-daemon \ + --start \ + --background \ + --make-pidfile \ + --pidfile ${SRP_DAEMON_PID:-/var/run/srpd.pid} \ + --exec /usr/sbin/srp_daemon -- ${SRP_DAEMON_OPTS:- -e -R 60} + eend $? + +} + +stop() { + ebegin "Stopping srp_daemon" + start-stop-daemon --stop --pidfile ${SRP_DAEMON_PID:-/var/run/srpd.pid} + eend $? + ebegin "Unloading ib_srp module" + rmmod ib_srp + eend $? +} |