3.3.2 Starting the rlm Server at System Boot Time on Unix Systems
On most Unix systems, system services are started at boot time, usually via startup scripts located in /etc/rc.something. For example, on 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. Note that you must install this startup script as root.
Note: 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 five 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