Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

executable file 90 lines (83 sloc) 2.341 kb
#!/bin/sh
#
# radiusd Start the radius daemon.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# Copyright (C) 2001 The FreeRADIUS Project http://www.freeradius.org
prefix=@prefix@
exec_prefix=@exec_prefix@
sbindir=@sbindir@
localstatedir=@localstatedir@
logdir=@logdir@
rundir=${localstatedir}/run/radiusd
RADIUSD=$sbindir/radiusd
WATCHER=$sbindir/radwatch
DESC="Freeradius server"
NAME1=radiusd
NAME2=radwatch
ARGS="-y"
test -f $RADIUSD || exit 0
case "$1" in
start)
if [ ! -f $logdir/radutmp ]
then
>$logdir/radutmp
fi
echo -n "Starting $DESC:"
if [ -x $WATCHER ]
then
echo -n " radwatch"
start-stop-daemon --start --quiet --startas $WATCHER \
--pidfile $rundir/$NAME2.pid --exec $RADIUSD -- $ARGS
# and the watcher starts radiusd.
echo -n " radiusd"
else
echo -n " radiusd"
start-stop-daemon --start --quiet \
--pidfile $rundir/$NAME1.pid --exec $RADIUSD -- $ARGS
fi
echo "."
;;
stop)
[ -z "$2" ] && echo -n "Stopping $DESC: "
if [ -x $WATCHER ]
then
[ -z "$2" ] && echo -n "radwatch "
start-stop-daemon --stop --quiet \
--pidfile $rundir/$NAME2.pid -- exec $RADWATCH
# but we have to stop radiusd manually.
killall radiusd 2>/dev/null
else
start-stop-daemon --stop --quiet \
--pidfile $rundir/$NAME1.pid --exec $RADIUSD
fi
[ -z "$2" ] && echo "radiusd."
;;
reload|force-reload)
echo "Reloading $DESC configuration files."
start-stop-daemon --stop --signal 1 --quiet --pidfile \
$rundir/$NAME1.pid --exec $RADIUSD
;;
restart)
sh $0 stop quiet
sleep 3
sh $0 start
;;
*)
echo "Usage: /etc/init.d/$NAME1 {start|stop|reload|restart}"
exit 1
esac
exit 0
Jump to Line
Something went wrong with that request. Please try again.