LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-03-2005, 03:51 PM   #1
dissectional
LQ Newbie
 
Registered: Apr 2004
Posts: 8

Rep: Reputation: 0
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
 
Old 11-03-2005, 04:05 PM   #2
as2100
LQ Newbie
 
Registered: Oct 2004
Posts: 7

Rep: Reputation: 0
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'.
 
Old 11-03-2005, 04:07 PM   #3
glvgfz
LQ Newbie
 
Registered: Sep 2005
Location: Sydney, Australia
Distribution: Vector Linux
Posts: 26

Rep: Reputation: 15
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').
 
Old 11-03-2005, 06:47 PM   #4
dissectional
LQ Newbie
 
Registered: Apr 2004
Posts: 8

Original Poster
Rep: Reputation: 0
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?
 
Old 11-03-2005, 06:50 PM   #5
glvgfz
LQ Newbie
 
Registered: Sep 2005
Location: Sydney, Australia
Distribution: Vector Linux
Posts: 26

Rep: Reputation: 15
Quote:
Originally posted by dissectional
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?
Have you tried "GNU Screen"?
 
Old 11-03-2005, 06:58 PM   #6
dissectional
LQ Newbie
 
Registered: Apr 2004
Posts: 8

Original Poster
Rep: Reputation: 0
Sorry, no. Googling it now
 
Old 11-03-2005, 07:09 PM   #7
glvgfz
LQ Newbie
 
Registered: Sep 2005
Location: Sydney, Australia
Distribution: Vector Linux
Posts: 26

Rep: Reputation: 15
Quote:
Originally posted by dissectional
Sorry, no. Googling it now
Here are a couple of tutorials I found helpfull:
http://gentoo-wiki.com/TIP_Using_screen
http://www.kuro5hin.org/story/2004/3/9/16838/14935
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Python noob - running programs in the background / recieving signals form the OS crm Programming 0 09-18-2005 07:11 AM
running a program in background of X using & Dachy Linux - General 1 09-13-2005 11:38 AM
Programs running in background on linux?? JellyStones Linux - General 4 02-10-2004 05:42 AM
running programs in background koiphish Linux - Software 0 07-07-2003 01:48 AM
Running Linux & Installing Programs ineedacookie Linux - Newbie 1 11-19-2002 03:24 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:32 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration