Leaving a process running after log-off

  • Follow


Hello NG,

Can anybody tell me how to leave a process running after logging off? I
have tried postfixing with '&', which leaves my terminal clear to do
other stuff, but as soon as I close my terminal window, the process
terminates (I can see this by watching the running processes with 'top'
in another terminal window). How do I keep a process running after
logging off?

Thanks in advance!

Best,

M.L.

0
Reply morten.langer (90) 5/17/2006 11:33:06 PM

On Wed, 17 May 2006, M.L. wrote:

> Can anybody tell me how to leave a process running after logging off? I
> have tried postfixing with '&', which leaves my terminal clear to do
> other stuff, but as soon as I close my terminal window, the process
> terminates (I can see this by watching the running processes with 'top'
> in another terminal window). How do I keep a process running after
> logging off?

You need to use the nohup command:

	$ nohup my_command &

Closing a terminal (or logginh out) causes a NOHUP signal to be sent
to the appropriate processes.  The nohup command circumvents this.

HTH,

-- 
Rich Teer, SCNA, SCSA, OpenSolaris CAB member

President,
Rite Online Inc.

Voice: +1 (250) 979-1638
URL: http://www.rite-group.com/rich
0
Reply Rich 5/17/2006 11:38:48 PM


Hi!

Thanks! I'll give it a try. Also thanks for your answer a few days ago
in my other thread (foce cp to overwrite existing files) - I just
noticed it now :)

Best,

M.L.

0
Reply M 5/17/2006 11:43:11 PM

On Wed, 17 May 2006 16:33:06 -0700, M.L. wrote:

> Can anybody tell me how to leave a process running after logging off?

Use GNU screen.

0
Reply Dave 5/17/2006 11:43:32 PM

M.L. <morten.langer@gmail.com> wrote:
> Hello NG,
> 
> Can anybody tell me how to leave a process running after logging off? I
> have tried postfixing with '&', which leaves my terminal clear to do
> other stuff, but as soon as I close my terminal window, the process
> terminates (I can see this by watching the running processes with 'top'
> in another terminal window). How do I keep a process running after
> logging off?
> 
> Thanks in advance!

# nohup (job) &

Colin
0
Reply Colin 5/18/2006 12:50:17 AM

M.L. wrote:
>
> Can anybody tell me how to leave a process running after logging off?
>
As other said, 'nohup <command> &' will work but most of the times,
some times depending on the terminal, connection type 'ssh, telnet, r*'
it may not work. In general, I use
'at now' command which always works on any unix platform.

0
Reply Vahid 5/18/2006 1:36:55 AM

Vahid Moghaddasi wrote:
> M.L. wrote:
>> Can anybody tell me how to leave a process running after logging off?
>>
> As other said, 'nohup <command> &' will work but most of the times,
> some times depending on the terminal, connection type 'ssh, telnet, r*'
> it may not work. In general, I use
> 'at now' command which always works on any unix platform.
> 


On Linux, in C, it's possible to call daemon() to detach the prog... Is 
it possible with Solaris ?

My (little) research was unsuccessful

Thanks in advance...
Michael
0
Reply Michael 5/18/2006 11:02:03 AM

Hi,

Vahid Moghaddasi wrote:
> M.L. wrote:
> 
>>Can anybody tell me how to leave a process running after logging off?
>>
> 
> As other said, 'nohup <command> &' will work but most of the times,
> some times depending on the terminal, connection type 'ssh, telnet, r*'
> it may not work. In general, I use
> 'at now' command which always works on any unix platform.
> 
With the benefit of having a email when/if it terminates!

/michael

0
Reply Michael 5/18/2006 12:13:06 PM

Vahid  Moghaddasi <moghaddasi@gmail.com> wrote:
> M.L. wrote:
>>
>> Can anybody tell me how to leave a process running after logging off?
>>
> As other said, 'nohup <command> &' will work but most of the times,
> some times depending on the terminal, connection type 'ssh, telnet, r*'
> it may not work. In general, I use
> 'at now' command which always works on any unix platform.

Good alternative, but can you give an example of when nohup fails? I've
never seen it not work, that I can remember.

Colin
0
Reply Colin 5/18/2006 5:56:41 PM

I found that it failed with vncserver

G



"Colin B." <cbigam@somewhereelse.nucleus.com> wrote in message 
news:446cb557@news.nucleus.com...
> Vahid  Moghaddasi <moghaddasi@gmail.com> wrote:
>> M.L. wrote:
>>>
>>> Can anybody tell me how to leave a process running after logging off?
>>>
>> As other said, 'nohup <command> &' will work but most of the times,
>> some times depending on the terminal, connection type 'ssh, telnet, r*'
>> it may not work. In general, I use
>> 'at now' command which always works on any unix platform.
>
> Good alternative, but can you give an example of when nohup fails? I've
> never seen it not work, that I can remember.
>
> Colin 


0
Reply george2 8/13/2007 10:43:38 AM

9 Replies
845 Views

(page loaded in 0.142 seconds)

Similiar Articles:













7/21/2012 8:22:10 PM


Reply: