← Back to team overview

dhis2-users team mailing list archive

DHIS2 not restarting with Server after Bootup [SOLVED]

 

Hello Community,

I have DHIS2 2.22 running on ubuntu server 14.04. I have:

- setup a the tomcat file with the contents:

#!/bin/sh
#Tomcat init script
HOME=/home/dhis/tomcat/bin
case $1 in
start)
  sh ${HOME}/startup.sh
  ;;
stop)
  sh ${HOME}/shutdown.sh
  ;;
restart)
  sh ${HOME}/shutdown.sh
  sleep 5
  sh ${HOME}/startup.sh
  ;;
esac
exit 0



- executed the commands

> sudo chmod +x /etc/init.d/tomcat

> sudo /usr/sbin/update-rc.d -f tomcat defaults 81
update-rc.d: warning: /etc/init.d/tomcat missing LSB information
update-rc.d: see <http://wiki.debian.org/LSBInitScripts>
 Adding system startup for /etc/init.d/tomcat ...
   /etc/rc0.d/K81tomcat -> ../init.d/tomcat
   /etc/rc1.d/K81tomcat -> ../init.d/tomcat
   /etc/rc6.d/K81tomcat -> ../init.d/tomcat
   /etc/rc2.d/S81tomcat -> ../init.d/tomcat
   /etc/rc3.d/S81tomcat -> ../init.d/tomcat
   /etc/rc4.d/S81tomcat -> ../init.d/tomcat
   /etc/rc5.d/S81tomcat -> ../init.d/tomcat


*I wonder if there's a problem on the warnings.

On Server REBOOT. Tomcat starts but I get a 404 error until I shutdown
and restart
Tomcat. I noticed that the *HOME *variable in the */etc/init.d/tomcat* file
was not pointing to my *tomcat-<user> instance*.

So I changed the line *HOME=/home/dhis/tomcat/bin *to
*HOME=/home/dhis/tomcat-<user>/bin. *In my case
*HOME=/home/dhis/tomcat-dhis/bin*.

At this point I still got the 4*04*.

Checking the */etc/init.d/* directory showed two tomcat files, another
called *tomcat7*. Assuming this file could be starting at startup without
reference to my *tomcat-dhis*, i renamed it to *tomcat7_bu*. Run > sudo
reboot and it worked.

Please recommend if there's a better solution. Also, is there a better way
of presenting solutions to problems like on stackexchange.com?

I hope this helps someone else in my situation.

Regards,
Adam

Follow ups