Re: (PM) PID for radiusd

Chris Parker (cparker@starnetusa.net)
Tue, 05 May 1998 10:54:24 -0500

At 10:24 AM 5/6/98 -0400, fil wrote:
>You can make 2 scripts one that starts and one that stops radius. My look
>like this.

Or, if you don't have a killall that can kill only specific targets, try
the following script which both starts and stops, radiusd. :)

#!/bin/sh
#
# Control the Radius Server

case "$1" in
'start')
if [ -f /usr/local/bin/radiusd ] ; then
echo "Starting Radius Now"
/usr/local/bin/radiusd
fi
;;
'stop')
PID=`/usr/bin/ps -e -u 0|/usr/bin/fgrep radiusd|/usr/bin/awk '{print
$1}'`
if [ ! -z "$PID" ] ; then
/usr/bin/kill ${PID} 1>/dev/null 2>&1
fi
;;
*)
echo "Usage: radius { start | stop }"
;;
esac
exit 0
#EOSCRIPT

You call the script with either start or stop as an argument, and is probably
a little more portable then relying on killall. You may need to massage it
slightly, this works on a Sun machine, but paths to stuff may be slightly
different on you machine. It also assumes a SVR4 style ps. Knock yourselves
out. :)

This probably also belongs in portmaster-radius, so I've sent it there.

-Chris

--
   \\\|||///  \  Chris Parker: Systems Administration and Development
   \ ~   ~ /   \   cparker@starnetusa.net   \   cparker@megapop.net
   | @   @ |    \    www.starnetusa.net      \    www.megapop.net
oOo---(_)---oOo--\------------------------------------------------------
                  \ Without C we would have 'obol', 'basi', and 'pasal'

- To unsubscribe, email 'majordomo@livingston.com' with 'unsubscribe portmaster-users' in the body of the message. Searchable list archive: <URL:http://www.livingston.com/Tech/archive/>