Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site mtxinu.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!decvax!ittvax!dcdwest!sdcsvax!sdcrdcf!hplabs!intelca!qantel!dual!unisoft!mtxinu!ed From: ed@mtxinu.UUCP (Ed Gould) Newsgroups: net.bugs.4bsd,net.unix-wizards Subject: Re: csh/jobs funniness Message-ID: <293@mtxinu.UUCP> Date: Wed, 27-Feb-85 18:03:11 EST Article-I.D.: mtxinu.293 Posted: Wed Feb 27 18:03:11 1985 Date-Received: Mon, 4-Mar-85 07:04:03 EST References: <1113@seismo.UUCP> Organization: mt Xinu, Berkeley, CA Lines: 27 Xref: watmath net.bugs.4bsd:1417 net.unix-wizards:12279 > Under csh if you have a job running in the background, jobs says running > and ps will give a stat of R indicating runnable. If you send the process > a signal 17 or 18 (STOP,TSTP) using kill, jobs will indicate the process > has stopped and ps will indicate T for stopped. So far everything is fine, > however if you restart the job using using kill -19 pid (or -CONT) the > process does restart, ps will give a STAT of R, but jobs will indicate > still stopped. This happens on both our VAX and SUN running 4.2bsd. > Any comments or solutions? > > seismo!tiberio There's no way for the shell to know that the job has been restarted, unless it did the restart itself. It knows that it was stopped, because parents get notified of such events via a wait() call (or variant). Usually, it's safer to stop and start processes using csh's builtins, since they will correctly deal with multiple processes in a job. (In case it's not clear how to restart a job in csh, use the "fg" or "bg" builtins, e.g. "fg %5" to bring job #5 to the foreground. "Fg" or "bg" without arguments will operate on the "current" job, noted with a "+" in the output from "jobs". There are also synonyms: "%n" == "fg %n", "%n&" == "bg %n", etc.) -- Ed Gould mt Xinu, 739 Allston Way, Berkeley, CA 94710 USA {ucbvax,decvax}!mtxinu!ed +1 415 644 0146