How to automatic start JasperReports Server on Ubuntu after restart or start ubuntu
INFO.
Ubuntu 14.04 LTS
JasperReports Server 5.6.0
I'm use manual start cd /jasperreports-server-cp-5.6.0/ ./ctlscript.sh start
Is there a way to automate this?
How to automatic start JasperReports Server on Ubuntu after restart or start ubuntu
INFO.
Ubuntu 14.04 LTS
JasperReports Server 5.6.0
I'm use manual start cd /jasperreports-server-cp-5.6.0/ ./ctlscript.sh start
Is there a way to automate this?
Credit WEB :http://sochinda.wordpress.com/2014/01/13/adding-jasperserver-as-service-in-ubuntu/
I Make automatic :
Create file called jasperserver in init.d
#sudo nano /etc/init.d/jasperserver
Insert this text:
#!/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/jasperreports-server-cp-5.6.0"
case "$1" in
start)
if [ -f $JASPER_HOME/ctlscript.sh ]; then
echo "Starting JasperServer"
$JASPER_HOME/ctlscript.sh start
fi
;;
stop)
if [ -f $JASPER_HOME/ctlscript.sh ]; then
echo "Stopping JasperServer"
$JASPER_HOME/ctlscript.sh stop
fi
;;
restart)
if [ -f $JASPER_HOME/ctlscript.sh ]; then
echo "Restarting JasperServer"
$JASPER_HOME/ctlscript.sh restart
fi
;;
status)
if [ -f $JASPER_HOME/ctlscript.sh ]; then
$JASPER_HOME/ctlscript.sh status
fi
;;
*)
echo $"Usage: $0 {start|stop|restart|status}"
exit 1
;;
esac
Set jasperserver in init.d as execute permission
> #sudo chmod +x /etc/init.d/jasperserver
Update jserperserver as default service in Ubuntu
> #sudo update-rc.d jasperserver defaults
can use command as
#sudo service jasperserver start
and Add service /etc/rc1.d/K20jasperserver in startup application Ubuntu.
Finish reboot Ubuntu.
Will Automaitc start.
The above answer worked excellently, but it is useful to note that you need to set your Jasper Server home directory:
JASPER_HOME="/opt/jasperreports-server-cp-5.6.0"
in the startup script. If you do not change it to match your version, the script fails silently when run.
upstartjob. There is an example on Ask Ubuntu. – garethTheRed Oct 08 '14 at 09:44