Running programs in background via & parameter
Hi,
I use a DYNDNS for my website and use an program called inadyn in order to automaticly verify my IP address with DYNDNS.org every couple minutes as I have a DHCP lease from my ISP. Inadyn when run refreshes this info every couple minutes or so. I feed inadyn my details via command line parameters, then apply a '&' at the end of the command in order to get it to run in the 'background' - I assume this is a good practice? Anyway - I have a couple questions regarding this: 1.) Does this continue to run in the background even after I log off? ( via SSH ) 2.) Is there anyway to 'call' this program back into the foreground so I can view its output again? After I feed it the & parameter it effectively disappears, albeit continues running. I'd like to get it 'back' when I like to view output if this is possible. Cheers, - dissectional |
Sure, it'll continue to run as your user even after you log off.
Also, if you want to view any of your backgrounded jobs- use the command 'jobs'. To actually bring up the backgrounded job, use the command 'fg'. |
1) AFAIK, when you log of most processes get killed. However some processes can detatch themselves and remain after you log off. From what I understand the shell kills the spawned process when you log off, but if the spawned process itself created another process then that does not get killed (correction or confirmation required).
The best way to go about something like this is to use the "GNU Screen" program. It would allow you to detach the terminal from the process and then reattach to it later. 2) To get the program back type in 'fg' (you can also read up about 'bg'). |
Cheers guys.
While logged in, I can use the jobs and bg commands to display and also 'mount' the background process again. However - after I log off and back on again, the process continues running, albeit is no longer retrievable via jobs or bg. Are there any possible solutions to this - or is this a case of tough luck? |
Quote:
|
Sorry, no. Googling it now :)
|
Quote:
http://gentoo-wiki.com/TIP_Using_screen http://www.kuro5hin.org/story/2004/3/9/16838/14935 |
All times are GMT -5. The time now is 02:12 PM. |