RSS

Adding Jasperserver as Service in Ubuntu

13 Jan

By Sochinda

After install jasper report server in Ubuntu server, using terminal as bellow:

  • 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-4.2.1"

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

Finally, we can use command as:

#sudo service jasperserver start|stop|restart

Reference from: http://community.jaspersoft.com/questions/541044/auto-start-boot

Advertisements
 
Leave a comment

Posted by on January 13, 2014 in JasperReport, Ubuntu

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: