Configure JasperReports Server Autostart

Configure Autostart

JasperReports Server is not configured to start automatically. Do the following steps to configure JasperReports Server to automatically start up on Linux.

Log in to the reports server to run the commands as an admin user (e.g. use sudo).

Find the bash jasperserver.init script in the reporting directory where you unzipped the reports pack.

Copy it to the service directory, e.g.  /etc/init.d/ 

Change permissions on the script to execute 

# chmod +x /etc/init.d/jasperserver


This enables you to use following services: start|stop|restart|status. For example

# service jasperserver status
# service jasperserver start
# service jasperserver stop
# service jasperserver restart

Add the service to start on boot up

# chkconfig --add jasperserver

Check that service has loaded

# chkconfig --list | grep jasperserver
jasperserver       0:off    1:off    2:on    3:on    4:on    5:on    6:off

 

jasperserver Script 

jasperserver script
#!/bin/bash
#
# jasperserver
#
# chkconfig: 2345 95 15
#
# description: Jaspersoft Reports Server
#
# Start/Stop of JasperReports Server
#
RETVAL=$?
JASPER_HOME="/opt/jasperreports-server-cp-6.2.0"
JASPER_USER=root
 
case "$1" in
  start) 
    if [ -f $JASPER_HOME/ctlscript.sh ]; then
      echo "Starting JasperServer"
      su $JASPER_USER -c "$JASPER_HOME/ctlscript.sh start"
    fi
    ;; 
  stop) 
    if [ -f $JASPER_HOME/ctlscript.sh ]; then
      echo "Stopping JasperServer"
      su $JASPER_USER -c "$JASPER_HOME/ctlscript.sh stop"
    fi
    ;; 
  restart) 
    if [ -f $JASPER_HOME/ctlscript.sh ]; then
      echo "Restarting JasperServer"
      su $JASPER_USER -c "$JASPER_HOME/ctlscript.sh restart"
    fi
    ;; 
  status) 
    if [ -f $JASPER_HOME/ctlscript.sh ]; then
      su $JASPER_USER -c "$JASPER_HOME/ctlscript.sh status"
    fi
    ;; 
  *) 
    echo $"Usage: $0 {start|stop|restart|status}"
    exit 1 
    ;; 
esac
exit $RETVAL

Copyright © 2006-2022, Abiquo Holdings SL. All rights reserved