It’s located in /etc/init.d
After that I created a symbolic link to /usr/sbin/rctomcat5
Then I used insserv to activate the script and set the runlevels to 3 and 5 via YAST
Unfortunately after rebooting the system I get an error that there must be a least one java environment variable set. Where do I have to set the variable (I though I just have to set them in the script)
Can any help me find a solution
BTW: The script works fine after booting using the console
On 03/09/2010 11:16 AM, flekschas wrote:
>
> Hi,
> I manually installed tomcat5 on my server and want it to start directly
> after booting.
>
> I wrote a short Init-script for that:
>
> #!/bin/sh
> ### BEGIN INIT INFO
> # Provides: tomcat
> # Required-Start: $network $syslog $remote_fs
> # Should-Start: $named $syslog $time
> # Required-Stop: $network $syslog
> # Should-Stop: $named $syslog $time
> # Default-Start: 3 5
> # Default-Stop: 0 1 2 6
> # Short-Description: Tomcat Servlet Container
> # Description: Start Tomcat to allow JAVA server pages
> ### END INIT INFO
>
> # rc.status
> . /etc/rc.status
> rc_reset
>
> # Variables
> # Java
> JAVA_HOME="/etc/alternatives/jre"
> JRE_HOME="/etc/alternatives/jre"
>
> # Tomcat
> CATALINA_BASE="/srv/apache-tomcat-5.5.27"
> CATALINA_HOME="/srv/apache-tomcat-5.5.27"
> JASPER_HOME="/srv/apache-tomcat-5.5.27"
> CATALINA_TMPDIR="/srv/apache-tomcat-5.5.27/temp"
>
> case “$1” in
> start)
> echo “Starting Tomcat 5.5.27”
> /srv/apache-tomcat-5.5.27/bin/startup.sh
> rc_status -v
> ;;
> stop)
> echo “Shutting down Tomcat 5.5.27”
> /srv/apache-tomcat-5.5.27/bin/shutdown.sh
> rc_status -v
> ;;
> restart)
> $0 stop
> echo “Waiting 5s …”
> $0 start
> rc_status
> ;;
> *)
> echo “Usage: $0 {start|stop|restart}”
> exit 1
> esac
> rc_exit
>
> It’s located in /etc/init.d
> After that I created a symbolic link to /usr/sbin/rctomcat5
> Then I used insserv to activate the script and set the runlevels to 3
> and 5 via YAST
>
> Unfortunately after rebooting the system I get an error that there must
> be a least one java environment variable set. Where do I have to set the
> variable (I though I just have to set them in the script)
>
> Can any help me find a solution
>
> BTW: The script works fine after booting using the console
>
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.12 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
I thought about that as well and already tested it but nothing changed. Even though the variables are exported they’re not available outside the script.
What wonders me is that I checked the init script from tomcat6 and there are no environment variables set too (or I don’t see them)
Also, with that in mind, what does the following return from your console
when you are able to load Tomcat manually after booting?
env | grep -i java
Finally for serious troubleshooting fun run the script manually as follows
and see what it shows in case something useful is returned:
bash -x /usr/sbin/rctomcat5 start
This will generate a bunch of output so be sure your scrollback buffer in
your shell is nice and high.
Good luck.
On 03/10/2010 09:06 AM, flekschas wrote:
>
> I thought about that as well and already tested it but nothing changed.
> Even though the variables are exported they’re not available outside the
> script.
> What wonders me is that I checked the init script from tomcat6 and
> there are no environment variables set too (or I don’t see them)
>
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.12 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
Okay
Everything is fine now. It had nothing to do with the script. Another application caused an error by apache which led to this error.
Thanks for you help
Interesting. Thanks for posting back your results.
Good luck.
On 03/10/2010 12:26 PM, flekschas wrote:
>
> Okay
> Everything is fine now. It had nothing to do with the script. Another
> application caused an error by apache which led to this error.
> Thanks for you help
>
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.12 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/