how can i bring the backgroud process to foreground
Linux - EnterpriseThis forum is for all items relating to using Linux in the Enterprise.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
actually, i don't know how to do, since when you run a script (owned by your shell), can be in background ot not, it will receive a SIGHUP signal when you close your shell (which default action is to terminate the script).
The nohup app is there to make the shell to "disown" the script so that it won't receive this signal at shell termination. The fact that your script isn't owned by your shell doesn't allow your shell to consider it as a shell job, and so i don't think it is possible to put it in foreground of the shell...
the only walkthrough i see is to make your script handle the SIGHUP signal (by registering an appropriate handler, see "man signal" or "man sigaction" for more info), in order to make sure it won't quit after shell termination. In this situation you won't need the nohup application and so your script will still be owned by your shell, so you will be able to put it in foreground.
However, note that this is only true until your shell is alive (i don't know if it is possible to make a new shell re-own a script that was own by another shell...) : your script will still run after you close your shell, but it won't be sufficient to put it in foreground in another shell...
i hope this is understandable, cause i don't think my post is -_-'
so if you need explanations, don't hesitate!
No, tail -f is not putting the job back into foreground. The tail -f is just creating a pipe that is copying the output of nohup.out onto your screen as it is written. The process is still disowned, you can't respond to prompts the process attempts to make to it's terminal.
So even if it wants a password you can't provide one.