[RADIATOR] linux init script patch

Heikki Vatiainen hvn at open.com.au
Mon May 23 16:07:48 CDT 2011


On 05/20/2011 12:01 PM, Alexander Hartmaier wrote:

> In my endless quest for a working init script to ease config for new
> users here's a patch against Radiator-4.8 + patches from today (this
> includes two patches to the linux init script).

Thanks. I have added this to the list to check before next release.
Making startup scripts and RPMS universal seems to be an endless quest
from what I have seen :)

> This is to make it work on a Debian 6 box with Radiator installed with
> perl Makefile.PL; make install which installs into /usr/local/bin and
> not /usr/bin as the default init script points at.
> I assume that the rpm installs a working init script so the one in the
> goodies dir should work for people installing from the tar.gz.

Good point. The locations are different. The script that comes with RPM
is currently the same as goodies/linux-radiator.init.

> Also as I pointed out before the pid file should be in the /var/run dir
> to be LSB conform.
> If you want to run radiator as non-root it has to go in a /var/run
> subdir that is owned or at least writeable by the user.

Running as non-root might be the reason why the pid file is in the log
directory by default. Permissions for log files have to match the user
radiusd runs on, so this makes the log dir very convenient place to have
the pid file too.

As an example, a quick look at Ubuntu 10.04 shows its /var/run is a
tmpfs and the startup scripts seem to need code to create the
subdirectry during every boot.

It's certainly possible to change to /var/run, but it is a bit hard to
say how difficult it is to do universally.

> Please also take a look at my mail from the 24th January!

Thanks, I will make a note of that too.

> I've also added an error message if the radiator binary can't be
> executed, occured for me because it couldn't be found at all, maybe a -f
> check should go in there before the -x.

Printing out the expected location might be useful here too.

> Cheers, Alex

Thanks again, Alex!

Heikki


> root at radiator:/etc/init.d# diff -u radiator
> /root/Radiator-4.8/goodies/linux-radiator.init
> --- radiator    2011-05-20 10:58:06.000000000 +0200
> +++ /root/Radiator-4.8/goodies/linux-radiator.init    2011-05-19
> 23:36:28.000000000 +0200
> @@ -6,7 +6,7 @@
>   # chkconfig: 2345 90 15
>   # description: radiator is the radius daemon required for RAS AAA.
>   # processname: /usr/bin/radiusd
> -# pidfile: /var/run/radiator.pid
> +# pidfile: /var/log/radius/radiusd.pid
>   # config: /etc/radiator/radius.cfg
>   # config: /etc/sysconfig/radiator
>   #
> @@ -41,9 +41,9 @@
> 
>   [ -f "${SYSCONFIG}" ] && . "${SYSCONFIG}"
> 
> -[ -z "${RADIUSD}" ] && RADIUSD=/usr/local/bin/radiusd
> +[ -z "${RADIUSD}" ] && RADIUSD=/usr/bin/radiusd
>   [ -z "${RADIATOR_CONFIG}" ] && RADIATOR_CONFIG=/etc/radiator/radius.cfg
> -[ -z "${RADIUSD_PIDFILE}" ] && RADIUSD_PIDFILE="/var/run/radiator.pid"
> +[ -z "${RADIUSD_PIDFILE}" ] &&
> RADIUSD_PIDFILE="/var/log/radius/radiusd.pid"
>   [ -z "${RADIATOR_ARGS}" ] && RADIATOR_ARGS=""
>   [ -z "${RADIUSD_ARGS}" ] && RADIUSD_ARGS="-pid_file $RADIUSD_PIDFILE
> -config_file $RADIATOR_CONFIG -daemon $RADIATOR_ARGS"
> 
> @@ -60,10 +60,7 @@
>   elif  [ -x /sbin/start-stop-daemon ]; then
>   # Debian
>   STARTPROC="/sbin/start-stop-daemon --start --pidfile
> ${RADIUSD_PIDFILE} --exec $RADIUSD -- $RADIUSD_ARGS"
> -CHECKPROC=
> -if [ -f ${RADIUSD_PIDFILE} ]; then
>   CHECKPROC="ps -fp `cat ${RADIUSD_PIDFILE}`"
> -fi
>   KILLPROC="/sbin/start-stop-daemon --stop --pidfile ${RADIUSD_PIDFILE}"
>   RELOADPROC="/sbin/start-stop-daemon --stop --signal HUP --pidfile
> ${RADIUSD_PIDFILE}"
>   TRACEUPPROC="/sbin/start-stop-daemon --stop --signal USR1 --pidfile
> ${RADIUSD_PIDFILE}"
> @@ -93,7 +90,6 @@
>   fi
> 
>   if [ ! -x $RADIUSD ]; then
> -    echo Unable to find executable radiusd binary!
>       exit 0
>   fi
> 
> 
> 
> *"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
> T-Systems Austria GesmbH   Rennweg 97-99, 1030 Wien
> Handelsgericht Wien, FN 79340b
> *"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
> Notice: This e-mail contains information that is confidential and may be privileged.
> If you are not the intended recipient, please notify the sender and then
> delete this e-mail immediately.
> *"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
> _______________________________________________
> 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