Setting up tomcat autostart on Linux?
15,996
Solution 1
Found this article here that did it for me.
http://www.sitepoint.com/jsp-quick-start-guide-linux/
Solution 2
/etc/init.d/tomcat-wepappname
#!/bin/sh
### BEGIN INIT INFO
# Provides: tomcat-wepappname
# Required-Start: $all
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: foo bar
# Description: long desc
### END INIT INFO
# Author: Foo Bar <[email protected]>
. /lib/lsb/init-functions
# Actions
case "$1" in
start)
log_action_begin_msg "Starting tomcat webapp" "tomcat-webappname"
su - tomcat-webappuser -c "/home/sites/tomcat-webappname/webappname.sh $1"
log_end_msg 0
;;
stop)
su - tomcat-webappuser -c "/home/sites/tomcat-webappname/webappname.sh $1"
;;
# restart)
# something else...
# ;;
esac
exit 0
At least, register the service:
update-rc.d activemq defaults
Related videos on Youtube
Comments
-
Daud Ahmad Khokhar over 1 year
So I have a java web app on tomcat installed on the server. How can I setup auto start for it so that it starts up automatically when the server is restarted?
-
Daud Ahmad Khokhar over 14 yearsNo man I'm using SUSE Enterprise Linux 9 here
-
cmo999 about 11 yearsbroken link....
-
cmo999 about 11 yearsi guess it should be : update-rc.d tomcat-wepappname defaults
-
Daud Ahmad Khokhar about 11 yearsLink updated...