![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| nohup.out | ramky79 | AIX | 5 | 10-23-2007 03:28 AM |
| Help on nohup | bobbyjohnz | UNIX for Advanced & Expert Users | 3 | 10-18-2006 08:56 AM |
| nohup ( no log message) | mike1022 | Shell Programming and Scripting | 1 | 09-16-2006 05:55 PM |
| Nohup | miwinter | UNIX for Dummies Questions & Answers | 3 | 07-21-2006 02:20 AM |
| nohup usage.. | charan81 | UNIX for Dummies Questions & Answers | 2 | 05-21-2006 11:41 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
nohup - help!
I find that if I use nohup (in bourne shell script) then all the interactive parts in my code are gone hidden... e.g., the places asking input from the user (such as ckyorn) will not be displayed. This is no good.
Is there a way to use nohup (or similar utility) and meanwhile, to keep the interactions with the user wherever required. I know this is not how the nohup is usually used - we'd expect the program to do something in the background for a long time without interactions- but I want to make my installation program a bit more robust. Thanks in advance for your help! |
| Forum Sponsor | ||
|
|
|
|||
|
Perhaps you don't understand the point of nohup.
The purpose is to allow a process to be detached from a controlling terminal and allow the process to continue running and not be killed by the SIGHUP generated when the login session closes. stdin is normally replaced by /dev/null. It is deliberately not designed for an interactive environment, and does it's best to detach itself from an interactive environment. When code calls "istty(0)" it will find that user input is not from an interactive terminal, if you have not redirected stdin, it will read exactly zero bytes from stdin. |
|
|||
|
What are you trying to achieve? Why do you need it to run in the background if it's needs to ask for user input?
|
|
|||
|
Thanks you so much for your response.
so yes, you are absolutely right about everything you said! And I wasn't clear about what I wanted to achieve. The interactive part actually is in the begining of the program; after all answers are collected the installer is running silently - for that part I want it to be able to continue even if the terminal is killed. I think it can be achieved by spliting the code into two scripts & apply the nohup on the second part. Are you saying the answer will automatically be 0/null wherever the code reads input from stdin while using nohup? Thanks again! |
|
|||
|
Quote:
Quote:
|
|
|||
|
Code:
When code calls "istty(0)" it will find that user input is not from an interactive terminal, if you have not redirected stdin, it will read exactly zero bytes from stdin. ( assuming the binary is invoked along with ' nohup ' ) |