- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- init.d script problem
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2003 10:06 AM
08-19-2003 10:06 AM
init.d script problem
Ideas?
-Tom
-------------------------------
#!/sbin/sh
CATALINA_HOME=/opt/tomcat
JAVA_HOME=/opt/java
export CATALINA_HOME
export JAVA_HOME
PATH=/sbin:/usr/sbin:/usr/bin
export PATH
rval=0
set_return() {
x=$?
if [ $x -ne 0 ]; then
echo "ERROR CODE $x"
rval=1
fi
}
case $1 in
start_msg)
echo "Start Tomcat"
;;
stop_msg)
echo "Stopping Tomcat"
;;
'start')
if [ -x $CATALINA_HOME/bin/startup.sh ] ; then
nohup nice $CATALINA_HOME/bin/startup.sh > /tmp/tomcat.out 2>&1 &
sleep 10
set_return
else
rval=2
fi
;;
'stop')
if [ -x $CATALINA_HOME/bin/shutdown.sh ] ; then
$CATALINA_HOME/bin/shutdown.sh &
set_return
else
rval=2
fi
;;
*)
echo "usage: $0 {start|stop}"
;;
esac
exit $rval
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2003 10:26 AM
08-19-2003 10:26 AM
Re: init.d script problem
When you say you run it from the command line, do you mean you run '/sbin/init.d/tomcat start' or 'nohup nice $CATALINA_HOME/bin/startup.sh' ?
Running the init script as root can make in difference in troubleshooting.
If you are already doing that, try introducing some logging into the Tomcat applcation, perhaps modifying the startup.sh for some 'echo "half-way_done"' kind of things. Perhaps another shell script that startup.sh calls...
If you start it manually and it works, does the init stop script work ?
Hope these suggestions help!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2003 11:02 AM
08-19-2003 11:02 AM
Re: init.d script problem
I mean I run /sbin/init.d/tomcat start as root, and it works correctly. And yes, /sbin/init.d/tomcat stop works as expected.
The Tomcat startup gets as far as launching the Java process, so adding more "got heres" in the script isn't likely to give me anything more. The log output from the Tomcat java process varies; if I extend the sleep from 10 seconds to 120 seconds, I get a bit more, but all normal processing, no hint of a reason for failure.
It appears that the process is getting a SIGHUP or SIGTERM, but nohup should prevent that. Somehow this appears to me to be the nub of the problem.
FYI, this is Tomcat 4.0.3 directly from the Apache Jakarta site, as we need a common install for HP-UX, Solaris and Windows. The startup.sh script execs catalina.sh, which invokes java with Tomcat's org.apache.catalina.startup.Bootstrap class.
-Tom
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2003 11:23 AM
08-19-2003 11:23 AM
Re: init.d script problem
Since you point out the script runs comepletly, but the resulting processes do not live long, it seems to point to some type of environment entity is killing it, which could be a parent process dying and bring (somehow) down the nohup'd & backgrounded processes.
Play with removing the nohup and '&'.
Hopefully someone with better scripting experience will read this and point out what we are forgetting to consider. ;)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2003 12:11 PM
08-19-2003 12:11 PM
Re: init.d script problem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2003 12:52 PM
08-19-2003 12:52 PM
Re: init.d script problem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-20-2003 05:27 AM
08-20-2003 05:27 AM
Re: init.d script problem
CATALINA_HOME=/opt/tomcat
JAVA_HOME=/opt/java
export CATALINA_HOME
export JAVA_HOME
PATH=/sbin:/usr/sbin:/usr/bin
export PATH
The startup.sh script takes care of anything else.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-20-2003 12:16 PM
08-20-2003 12:16 PM
Re: init.d script problem
at now << EOD > /tmp/tomcat.out 2>&1
nice $CATALINA_HOME/bin/startup.sh >> /tmp/tomcat.out 2>&1 &
EOD
Works like a charm. But why does "at" work when "nohup" doesn't?