- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: will process die if started without nohup comm...
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
Discussions
Discussions
Forums
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
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
тАО04-17-2007 05:59 PM
тАО04-17-2007 05:59 PM
will process die if started without nohup command after exiting terminal
Generally, Software applications or tools running on Unix are being started by a startup script.
This startup script which starts the unix process usually uses nohup or if nohup is not provided we start the processes by appending nohup command exclusively before the process startup script.
My question:
If script do not have nohup command inside it and if someone start the process and logs out of the terminal; will the process die ?
Are running prcesses adopt shell process as their parent process if started without nohup command ?
Thanks,
Shiv
- Tags:
- nohup
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-17-2007 07:11 PM
тАО04-17-2007 07:11 PM
Re: will process die if started without nohup command after exiting terminal
Cheers,
Wout
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-17-2007 08:28 PM
тАО04-17-2007 08:28 PM
Re: will process die if started without nohup command after exiting terminal
If it was written like a daemon it usually would use a technique accordingly termed daemonization.
This means that it would fork and exit the parent process.
The fork provided an exact child copy.
It would also do a chdir to / (or some chroot if provided), close any from the parent inherited file descriptors or redirect them (at leeast the first three), and finally become session leader (e.g. setsid()) to totally dissociate from the shell it was started from.
So processes that do this kind of daemonization would not require a nohup.
Process that lack this behaviour are better started with a nohup (or maybe as a batch job).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-17-2007 10:21 PM
тАО04-17-2007 10:21 PM
Re: will process die if started without nohup command after exiting terminal
The normal answer is yes.
In your case, if you are in doubt about it (deamons, etc) you can do a simple test.
Open two terminal sessions and just fireup your above script on the first one.
Do a ps on the processes started by script and note it.
Exit the terminal from you fired the script and check the processes from the second one.
You are done.
Regards,
Rasheed Tamton.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-18-2007 02:57 PM
тАО04-18-2007 02:57 PM
Re: will process die if started without nohup command after exiting terminal
Eg:
nohup SomeCommand > /dev/null 2>&1 &
My assumption was that if the parent went away the child process had nowhere to send its output so it died anyway. (Somebody please correct me if this assumption is incorrect.)
Other flavours of Unix can behave differently.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-18-2007 03:17 PM
тАО04-18-2007 03:17 PM
Re: will process die if started without nohup command after exiting terminal
Well, unless you are doing > /dev/tty, nohup(1) says it automatically redirects to nohup.out. And it also says if redirected to terminal, it sends to nohup.out. So it seems everything is covered.
>Other flavours of Unix can behave differently.
Unfortunately, that is probably true. :-(
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-19-2007 05:21 AM
тАО04-19-2007 05:21 AM
Re: will process die if started without nohup command after exiting terminal
Thanks,
Shiv
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-19-2007 06:06 AM
тАО04-19-2007 06:06 AM