- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Process started with startup script terminates
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
03-12-2004 06:26 AM
03-12-2004 06:26 AM
Process started with startup script terminates
I tried search for my problem in the forum but couldn't find the exact match, hence asking the question.
I have a startup script in run level 3. It starts two servers. One directly running the binary and second through another script.
The code goes something like this
mystartupscript.sh
-----------------------------------------------
SERVER1="/path/to/bin/server1
# Start server1
$SERVER1
# server1 runs as daemon and internally
# detaches from terminal
SERVER2="/path/to/server2.sh
$server2
exit 0
-----------------------------------------------
server2.sh
SERVER2_BIN="/path/to/bin/server2
$SERVER2 &
-----------------------------------------------
As the server1 is daemon and does not attach to terminal it starts up and runs fine when the system boots up.
However, the problem is with server2. It does start up, but gets terminated after sometime. May be when all processing of "rc3" is over.
I get following in rc.log
---------------------------------------------
( Terminating process 1569 ("/path/to/bin/server2 options") )
----------------------------------------------
1569 is the process id for server2. And next to pid is the command line with which the process was started.
What I can understand after some reading is that, server2.sh is not executed with nohup, but "server2" was started as background process. hence this should work. But for some reason its not working.
I cannot run "$server2 2>&1 >/dev/null" as $server2 echos the status and pid of the second server.
the 'mystartupscript.sh ' runs properly as cron job and both servers come up properly.
It also continues to run when I start it through login shell and then logout and exit that shell.
Any clues?
Apologies for long posting.
Thanks in advance
Rohan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2004 06:32 AM
03-12-2004 06:32 AM
Re: Process started with startup script terminates
You can try this yourself from a terminal. Just start something in the background and then do an 'exit'. You will get a warning message about running processes. If you exit again, you will be logged out and your process terminated.
When you start it through the login shell, how do you start it? Are you doing the exact same thing as the startup script?
I would start the process with 'nohup processname &' and see if the helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2004 06:38 AM
03-12-2004 06:38 AM
Re: Process started with startup script terminates
I find this useful when diagnosing such issues:
env > /tmp/env.txt
have the startup script dump its environment. Boot the box, copy off the file and restart the server.
Any environmental differences can effect start up results.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2004 09:37 PM
03-12-2004 09:37 PM
Re: Process started with startup script terminates
Same script I use while starting up server through terminal.
As I mentioned earlier, this works even when I exit from the login and the shell terminates.
However, I am not clear that why the server2 is terminated by 'rc3' or 'init' process?
Someone had suggested in one of the postings that starting the process in background is more safer than 'nohup'.
Still looking for better solution!
Thanks
Rohan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2004 12:46 AM
03-14-2004 12:46 AM
Re: Process started with startup script terminates
Probably I got the solution.
I'm now ignoring SIGHUP in my second server.
After ignoring SIGHUP, it works fine, from terminal as well as startup scripts.
Thanks a lot for your help
Rohan