Published:
Warning: This blog entry was written two or more years ago. Therefore, it may contain broken links, out-dated or misleading content, or information that is just plain wrong. Please read on with caution.
Start Railo/Resin on bootup
In "/opt/railo/contrib" is an init script. This should already have the correct paths specified. Simply copy the file to "/etc/rc.d/" and name it "rc.resin". Then add the follow to "/etc/rc.d/rc.local"
if [ -x /etc/rc.d/rc.resin ]; then
/etc/rc.d/rc.resin start
fi
You must give rc.resin execute permission
chmod 755 /etc/rc.d/rc.resin
Its also a good idea to use the apache user for railo.
chown -R apache:apache /opt/railo
Note: As of railo-3.1.1 and Resin 3.1.2, the contrib/init.resin file IS NOT CORRECT. Below is mine.
- "-pid $PID" is not a valid argument
- "start"/"stop" should be after $ARGS
- "-java_home" is not a valid argument
- "-resin_home" should be "-resin-home"
- The "$PID" file is no longer created, so remove all code referencing it.
JAVA_HOME=/usr/lib/java
RESIN_HOME=/opt/railo
export JAVA_HOME RESIN_HOME
USER=
EXE=$RESIN_HOME/bin/httpd.sh
ARGS="-resin-home $RESIN_HOME"
case "$1" in
start)
echo -n "Starting resin: "
if test -n "$USER"; then
su $USER -c "$EXE $ARGS start"
else
$EXE $ARGS start
fi
echo
;;
stop)
echo -n "Shutting down resin: "
$EXE stop
echo
;;
restart)
$0 stop
$0 start
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac
exit 0
Reader Comments