#!/bin/sh # iperf-udp iperf tcp service # # chkconfig: - 90 10 # description: iperf service for test TCP bandwidth performance # processname: iperf # pidfile: /var/run/iperf-udp.pid # Do not load RH compatibility interface. WITHOUT_RC_COMPAT=1 # Source function library. . /etc/init.d/functions RUNAS=_iperf PIDFILE=/var/run/iperf-udp.pid LOCKFILE=/var/lock/subsys/iperf-udp RETVAL=0 SourceIfNotEmpty /etc/sysconfig/iperf start() { start_daemon --make-pidfile --pidfile "$PIDFILE" --lockfile "$LOCKFILE" --user $RUNAS --displayname iperf-udp -- iperf $UDP_ARGS RETVAL=$? return $RETVAL } stop() { stop_daemon --pidfile "$PIDFILE" --lockfile "$LOCKFILE" --expect-user root --displayname iperf-udp -- su RETVAL=$? return $RETVAL } restart() { stop start } # See how we were called. case "$1" in start) start ;; stop) stop ;; restart) restart ;; condstop) if [ -e "$LOCKFILE" ]; then stop fi ;; condrestart) if [ -e "$LOCKFILE" ]; then restart fi ;; status) status --pidfile "$PIDFILE" --expect-user root --displayname iperf-udp -- su RETVAL=$? ;; *) msg_usage "${0##*/} {start|stop|restart|condstop|condrestart|status}" RETVAL=1 esac exit $RETVAL