[RADIATOR] linux-radiator.init minor additions

Heikki Vatiainen hvn at open.com.au
Thu Oct 25 15:49:59 CDT 2012


On 10/24/2012 05:41 PM, Aeneas Jaißle (sewikom GmbH) wrote:

> I just wanted to share a few minor changes in my linux-radiator.init script:

Hello Aeneas, and thanks for looking into these.

> # Added CHECKPROC definitions for SUSE
> # SuSE etc
> STARTPROC="/sbin/startproc $RADIUSD $RADIUSD_ARGS"
> CHECKPROC="ps -fp `cat ${RADIUSD_PIDFILE}`"

What do you think about this instead?

CHECKPROC="checkproc -p ${RADIUSD_PIDFILE} $RADIUSD"

It seems to work with openSUSE 11.4 and 12.2 and uses checkproc like
SUSE does with its own startup scripts.

The other changes seem to be addition of color coded 'success' or
'failed' output, am I correct? We are thinking not adding these since
some distributions already use the return values and then echo
appropriate messages. In this case the output would be quite confusing.

Thanks,
Heikki

> KILLPROC="killproc -p ${RADIUSD_PIDFILE} $RADIUSD"
> RELOADPROC="killproc -p ${RADIUSD_PIDFILE} -HUP $RADIUSD"
> TRACEUPPROC="killproc -p ${RADIUSD_PIDFILE} -USR1 $RADIUSD"
> TRACEDOWNPROC="killproc -p ${RADIUSD_PIDFILE} -USR2 $RADIUSD"
> else
> ...
> 
> # Added success or failure based on return code
> start() {
>     # don't do squat if we don't have the config file
>     if [ -f $RADIATOR_CONFIG ]; then
> 	echo -n "Starting Radiator: "
> 	$STARTPROC
> 	RETVAL=$?
> 	[ $RETVAL -eq 0 ] && echo -e "\e[00;32msuccess\e[00m"
> 	[ $RETVAL -ne 0 ] && echo -e "\e[00;31mfailed\e[00m with return code $RETVAL"
> 	else
> 	echo Unable to find config file $RADIATOR_CONFIG!
>     fi
>     return $RETVAL
> }
> 
> stop() {
>     echo -n "Shutting down Radiator: "
>     $KILLPROC
>     RETVAL=$?
> 	[ $RETVAL -eq 0 ] && echo -e "\e[00;32msuccess\e[00m"
> 	[ $RETVAL -ne 0 ] && echo -e "\e[00;31mfailed\e[00m with return code $RETVAL"
> 	return $RETVAL
> }
> 
> getstatus() {
> 	$CHECKPROC
> 	RETVAL=$?
> 	echo -n "Getting Radiator Status: "
> 	[ $RETVAL -eq 0 ] && echo -e "\e[00;32msuccess\e[00m"
> 	[ $RETVAL -ne 0 ] && echo -e "\e[00;31mfailed\e[00m with return code $RETVAL"
> 	return $RETVAL
> }
> 
> reload() {
> 	echo -n "Reloading Radiator configuration (via SIGHUP): "
> 	$RELOADPROC
> 	RETVAL=$?
> 	[ $RETVAL -eq 0 ] && echo -e "\e[00;32msuccess\e[00m"
> 	[ $RETVAL -ne 0 ] && echo -e "\e[00;31mfailed\e[00m with return code $RETVAL"
> 	return $RETVAL
> }
> 
> traceup() {
> 	echo -n "Increasing Trace Level by 1 (via USR1): "
> 	$TRACEUPPROC
> 	RETVAL=$?
> 	[ $RETVAL -eq 0 ] && echo -e "\e[00;32msuccess\e[00m"
> 	[ $RETVAL -ne 0 ] && echo -e "\e[00;31mfailed\e[00m with return code $RETVAL"
> 	return $RETVAL
> }
> 
> tracedown() {
> 	echo -n "Decreasing Trace Level by 1 (via USR2): "
> 	$TRACEDOWNPROC
> 	RETVAL=$?
> 	[ $RETVAL -eq 0 ] && echo -e "\e[00;32msuccess\e[00m"
> 	[ $RETVAL -ne 0 ] && echo -e "\e[00;31mfailed\e[00m with return code $RETVAL"
> 	return $RETVAL
> }
> ...
> 
> 
> 
> - Aeneas
> 
> _______________________________________________
> radiator mailing list
> radiator at open.com.au
> http://www.open.com.au/mailman/listinfo/radiator
> 


-- 
Heikki Vatiainen <hvn at open.com.au>

Radiator: the most portable, flexible and configurable RADIUS server
anywhere. SQL, proxy, DBM, files, LDAP, NIS+, password, NT, Emerald,
Platypus, Freeside, TACACS+, PAM, external, Active Directory, EAP, TLS,
TTLS, PEAP, TNC, WiMAX, RSA, Vasco, Yubikey, MOTP, HOTP, TOTP,
DIAMETER etc. Full source on Unix, Windows, MacOSX, Solaris, VMS,
NetWare etc.


More information about the radiator mailing list