3.3.3 Starting the RLM server at boot using initd on Linux

On most Unix® systems, system services are started at boot time, usually via startup scripts located in /etc/rc.<something>. For example, on Oracle® Solaris, the startup script might be placed in /etc/rc2.d/S98rlm. On Linux® systems, the script could be located in /etc/init.d/rlm, with a link to /etc/rc5.d/S98rlm. You must install this startup script as root.

Attention: The startup script should su to a different user so that the RLM servers are not running as root.

The following is an example of a script which would start RLM at boot time on Unix systems. Modify the first 5 variables for the target system.

#! /bin/sh
#
# rlm                Start/Stop rlm
#
#----------------------------------------------------------------
#----------------------------------------------------------------
#----------------------------------------------------------------
# NOTE:
# NOTE: Configure these 5 variables for your system
# NOTE:

# Set rlmuser to the user under which rlm will run
rlmuser=bobm

# Set rlmdir to the directory where the rlm binary is found
rlmdir=/home/bobm/rlm/dev/rlm

# Set rlmdir to the directory where the rlmdown binary is found
 rlmdowndir=$rlmdir

# Set licfile to the path to the license file
licfile=$rlmdir/x.lic

# Set debuglog to the path to the debug log
debuglog=+$rlmdir/rlm.dl
#----------------------------------------------------------------
#----------------------------------------------------------------
#----------------------------------------------------------------

start() {
echo $debuglog
        su - $rlmuser -c "$rlmdir/rlm -c $licfile -dlog $debuglog &"
}

stop() {
        su - $rlmuser -c "$rlmdowndir/rlmdown RLM -c $licfile -q"
}

case "$1" in 
  start)
        start
        ;;
  stop)
        stop
        ;;
  restart)
        stop
        sleep 2
        start
        ;;
*)

echo $"Usage: $0 {start|stop|restart}"
        exit 1
esac 

exit 0