From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20239 invoked from network); 6 May 2000 19:03:11 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 6 May 2000 19:03:11 -0000 Received: (qmail 13921 invoked by alias); 6 May 2000 19:03:03 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 11238 Received: (qmail 13865 invoked from network); 6 May 2000 19:02:59 -0000 To: zsh-workers@sunsite.auc.dk Subject: Re: fg/bg on FreeBSD. References: <1000506170828.ZM2063@candle.brasslantern.com> <1000506184503.ZM6391@candle.brasslantern.com> MIME-Version: 1.0 (generated by SEMI 1.13.7 - "Awazu") Content-Type: text/plain; charset=US-ASCII From: Tanaka Akira Date: 07 May 2000 04:03:56 +0900 In-Reply-To: <1000506184503.ZM6391@candle.brasslantern.com> (Bart Schaefer's message of "Sat, 6 May 2000 18:45:03 +0000") Message-ID: User-Agent: T-gnus/6.14.1 (based on Gnus v5.8.3) (revision 16) SEMI/1.13.7 (Awazu) FLIM/1.13.2 (Kasanui) Emacs/20.6 (i686-pc-linux-gnu) MULE/4.0 (HANANOEN) In article <1000506184503.ZM6391@candle.brasslantern.com>, "Bart Schaefer" writes: > OK, now, can you "fg" it, wait for the first sleep (but not the second) > to exit, then ^Z again and check the PGIDs? | Z:akr@dhcp21% ktrace -i zsh -f | dhcp21% sleep 30|sleep 100 | ^Z | zsh: suspended sleep 30 | sleep 100 | dhcp21% jobs -l | [1] + 29347 suspended sleep 30 | | 29348 suspended sleep 100 | dhcp21% ps j | USER PID PPID PGID SESS JOBC STAT TT TIME COMMAND | akr 29335 29333 29335 a0fe80 0 Is p0 0:00.11 /home/akr/.zsh/arch/i386-unknown-freebsd4.0/bin/zsh -l | akr 29346 29335 29346 a0fe80 1 S p0 0:00.07 zsh -f | akr 29347 29346 29347 a0fe80 2 T p0 0:00.00 sleep 30 | akr 29348 29346 29347 a0fe80 2 T p0 0:00.00 sleep 100 | akr 29349 29346 29349 a0fe80 1 R+ p0 0:00.00 ps j PGID of `sleep 100' is both 29347. No problem. | dhcp21% fg | [1] + continued sleep 30 | sleep 100 | ^Z | zsh: done sleep 30 | | zsh: suspended sleep 100 | dhcp21% ps j | USER PID PPID PGID SESS JOBC STAT TT TIME COMMAND | akr 29335 29333 29335 a0fe80 0 Is p0 0:00.11 /home/akr/.zsh/arch/i386-unknown-freebsd4.0/bin/zsh -l | akr 29346 29335 29346 a0fe80 1 S p0 0:00.08 zsh -f | akr 29348 29346 29347 a0fe80 1 T p0 0:00.00 sleep 100 | akr 29365 29346 29365 a0fe80 1 R+ p0 0:00.00 ps j | akr 29352 29350 29352 9099c0 0 Ss+ p1 0:00.12 /home/akr/.zsh/arch/i386-unknown-freebsd4.0/bin/zsh -l | dhcp21% The PGID is not changed: 29347. > Another test to try: > > echo | sleep 100 | sleep 200 > > If you ^Z this, do both sleeps get the same PGID, or do they each become > their own process group? (I'm hoping the latter, for sanity, otherwise > it's a guessing game as to what PID becomes the leader.) Wow! This cannot stop with ^Z. | Z:akr@dhcp21% zsh -f | dhcp21% echo $$ | 29385 | dhcp21% tty | /dev/ttyp0 | dhcp21% echo | sleep 100 | sleep 200 | ^Z `ps j' from another termianl before ^Z: | Z:akr@dhcp21% ps j | USER PID PPID PGID SESS JOBC STAT TT TIME COMMAND | akr 29335 29333 29335 a0fe80 0 Ss p0 0:00.12 /home/akr/.zsh/arch/i386 | akr 29385 29335 29385 a0fe80 1 S p0 0:00.03 zsh -f | akr 29388 29385 29388 a0fe80 1 S p0 0:00.00 sleep 100 | akr 29389 29385 29389 a0fe80 1 S+ p0 0:00.00 sleep 200 | akr 29352 29350 29352 9099c0 0 Ss p1 0:00.14 /home/akr/.zsh/arch/i386 | akr 29390 29352 29390 9099c0 1 R+ p1 0:00.00 ps j Hm. Two sleep commands has own PGID. They are both process group leader. `ps j' from another termianl after ^Z: | Z:akr@dhcp21% ps j | USER PID PPID PGID SESS JOBC STAT TT TIME COMMAND | akr 29335 29333 29335 a0fe80 0 Is p0 0:00.12 /home/akr/.zsh/arch/i386 | akr 29385 29335 29385 a0fe80 1 S p0 0:00.03 zsh -f | akr 29388 29385 29388 a0fe80 1 S p0 0:00.00 sleep 100 | akr 29389 29385 29389 a0fe80 1 T+ p0 0:00.00 sleep 200 | akr 29352 29350 29352 9099c0 0 Ss p1 0:00.14 /home/akr/.zsh/arch/i386 | akr 29391 29352 29391 9099c0 1 R+ p1 0:00.00 ps j Only `sleep 200' is stopped because foreground process group for ttyp0 is 29389. Maybe. -- Tanaka Akira