zsh-workers
 help / color / mirror / code / Atom feed
From: "Bart Schaefer" <schaefer@candle.brasslantern.com>
To: Tanaka Akira <akr@m17n.org>, zsh-workers@sunsite.auc.dk
Subject: Re: fg/bg on FreeBSD.
Date: Sat, 6 May 2000 18:45:03 +0000	[thread overview]
Message-ID: <1000506184503.ZM6391@candle.brasslantern.com> (raw)
In-Reply-To: <hvozoq3mux1.fsf@serein.m17n.org>

On May 7,  2:48am, Tanaka Akira wrote:
} Subject: Re: fg/bg on FreeBSD.
}
} In article <1000506170828.ZM2063@candle.brasslantern.com>,
}   "Bart Schaefer" <schaefer@candle.brasslantern.com> writes:
} 
} > Why is the PGID of sleep different on FreeBSD?  Did it change after the
} > sleep was started because the echo exited?
} 
} Possibly.  But NetBSD has no problem...

Yes, what I'm wondering is whether this is a FreeBSD bug.
 
} | Z:akr@dhcp21% ktrace -i zsh -f
} | dhcp21% sleep 100|sleep 200
} | ^Z
} | zsh: suspended  sleep 100 | sleep 200
} | dhcp21% jobs -l
} | [1]  + 29245 suspended  sleep 100 | 
} |        29246 suspended  sleep 200
} | dhcp21% ps j29245; ps j29246 
} | USER   PID  PPID  PGID   SESS JOBC STAT  TT       TIME COMMAND
} | akr  29245 29244 29245 94d480    2 T     p3    0:00.00 sleep 100
} | USER   PID  PPID  PGID   SESS JOBC STAT  TT       TIME COMMAND
} | akr  29246 29244 29245 94d480    2 T     p3    0:00.00 sleep 200
} 
} PGID is first sleep's PID.  It's good.
} 
} | dhcp21% bg
} | [1]  + continued  sleep 100 | sleep 200
} | dhcp21% ps j29245; ps j29246 
} | USER   PID  PPID  PGID   SESS JOBC STAT  TT       TIME COMMAND
} | akr  29245 29244 29245 94d480    2 I     p3    0:00.00 sleep 100
} | USER   PID  PPID  PGID   SESS JOBC STAT  TT       TIME COMMAND
} | akr  29246 29244 29245 94d480    2 I     p3    0:00.00 sleep 200
} 
} It's successfully resumed.

OK, now, can you "fg" it, wait for the first sleep (but not the second)
to exit, then ^Z again and check the PGIDs?

If the PGID is going to change every time the group leader exits, then
we've got a problem -- we can't simply record the group leader's PID and
keep using it unless we arrange for a group leader that's guaranteed to
stay alive for the whole pipeline.

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.)

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com


  reply	other threads:[~2000-05-06 18:45 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-05-06 15:03 Tanaka Akira
2000-05-06 17:08 ` Bart Schaefer
2000-05-06 17:48   ` Tanaka Akira
2000-05-06 18:45     ` Bart Schaefer [this message]
2000-05-06 19:03       ` Tanaka Akira
2000-05-06 19:58     ` Tanaka Akira
2000-05-06 21:23       ` Bart Schaefer
2000-05-06 21:41         ` Tanaka Akira
2000-05-08  8:48 Sven Wischnowsky
2000-05-08  9:17 ` Tanaka Akira

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1000506184503.ZM6391@candle.brasslantern.com \
    --to=schaefer@candle.brasslantern.com \
    --cc=akr@m17n.org \
    --cc=zsh-workers@sunsite.auc.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).