I have a service installed to start jasper reporting server on boot. I believe it is correctly setup.
here is the startup script placed in /etc/init.d/jasperserver
#!/bin/sh
### BEGIN INIT INFO
# Provides: jasperserver
# Required-Start:
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start JasperServer at boot time
# Description: Enable service provided by JasperServer.
### END INIT INFO
JASPER_HOME="/opt/jaspersoft/jasperreports-server-5.5"
case "$1" in
start)
if [ -f $JASPER_HOME/ctlscript.sh ]; then
echo "Starting JasperServer"
sudo -u ec2-user $JASPER_HOME/ctlscript.sh start
fi
;;
stop)
if [ -f $JASPER_HOME/ctlscript.sh ]; then
echo "Stopping JasperServer"
sudo -u ec2-user $JASPER_HOME/ctlscript.sh stop
fi
;;
restart)
if [ -f $JASPER_HOME/ctlscript.sh ]; then
echo "Restarting JasperServer"
sudo -u ec2-user $JASPER_HOME/ctlscript.sh restart
fi
;;
status)
if [ -f $JASPER_HOME/ctlscript.sh ]; then
sudo -u ec2-user $JASPER_HOME/ctlscript.sh status
fi
;;
*)
echo $"Usage: $0 {start|stop|restart|status}"
exit 1
;;
esac
Also, I run the command
sudo chmod +x /etc/init.d/jasperserver
I then have run the commands
sudo chkconfig --add jasperserver
sudo chkconfig jasperserver on
If I run:
chkconfig --list | grep jasper
I see:
jasperserver 0:off 1:off 2:on 3:on 4:on 5:on 6:off
I can also run:
sudo service jasperserver (start|stop|restart)
successfully
However when I issue a reboot, the service isn't running. I wondered if there's a way I can get logging information or enable logging to be able to tackle this.
More detail
uname -a
Linux jaspersoft.localdomain 3.10.42-52.145.amzn1.x86_64 #1 SMP Tue Jun 10 23:46:43 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
Also after adding the line:
# chkconfig: 2345 70 30
the symlinks are as follows:
[ec2-user@jaspersoft ~]$ ls -laF /etc/rc.d/rc3.d/*jasper*
lrwxrwxrwx 1 root root 22 Aug 6 08:09 /etc/rc.d/rc3.d/S70jasperserver -> ../init.d/jasperserver*
and likewise for /etc/rc.d/rc[2-5].d/jasper