[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: sleep & Co on Linux (was: disown, fg, jobs)

From: Paul Jarc
Subject: Re: sleep & Co on Linux (was: disown, fg, jobs)
Date: 21 Jun 2001 11:53:39 -0400
User-agent: Gnus/5.090004 (Oort Gnus v0.04) Emacs/20.7

Sven Mascheck <address@hidden> writes:
>> Dan Jacobson <address@hidden> writes:
>>> 0/tmp$ sleep 66666
>>> ^Z
>>> [1]+  Stopped                 sleep 66666
>>> 0/tmp$ sleep 2222&
>>> [2] 1196
>>> 0/tmp$ disown
>>> bash: warning: deleting stopped job 1 with process group 1195
>>> 0/tmp$ fg
>>> bash: fg: current: no such job
> It looks rather unexpected.
> AFAIK, this only happens on Linux.

No, you're thinking of a different issue.

> The example was also misleading (not related with disown),
> on Linux it's just:
> $ sleep 100
> ^Z
> [1]+ Stopped    sleep 100
> $ fg
> $
> I.e., the sleep(1) is *terminating* on SIGCONT (it sort of died
> already on SIGSTOP/TSTP).

But Dan's example *was* related to disown, not sleep's premature
termination.  The first sleep was started in the foreground, and was
put in the background, thus it was the "current job".  The second
sleep was started in the background, thus it did not become the
current job.  So disown, operating on the current job, got rid of the
first sleep, not the second.  (We never send the first sleep a SIGCONT
in this example, so whether it terminates in that case is irrelevant
here.)  Then since the current job was just disowned, fg had no
current job to operte on.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]