From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: Date: Fri, 20 Jun 2008 16:03:49 +0200 From: "Rudolf Sykora" To: "Fans of the OS Plan 9 from Bell Labs" <9fans@9fans.net> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_2527_17697070.1213970629134" Subject: [9fans] process group, processes running in the background Topicbox-Message-UUID: c3d6a584-ead3-11e9-9d60-3106f5b1d025 ------=_Part_2527_17697070.1213970629134 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hello, is there any simple way how to identify processes belonging to one concrete process group? Is there any simple way how to change a process' group? Is there anything like pstree in plan9? Thanks Ruda ------=_Part_2527_17697070.1213970629134 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hello,

is there any simple way how to identify processes belonging to one concrete process group?

Is there any simple way how to change a process' group?

Is there anything like pstree in plan9?

Thanks
Ruda
------=_Part_2527_17697070.1213970629134-- From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: Date: Fri, 20 Jun 2008 17:50:14 +0200 From: "Rudolf Sykora" To: "Fans of the OS Plan 9 from Bell Labs" <9fans@9fans.net> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_10051_10728496.1213977015068" References: Subject: Re: [9fans] process group, processes running in the background Topicbox-Message-UUID: c3deaf90-ead3-11e9-9d60-3106f5b1d025 ------=_Part_10051_10728496.1213977015068 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline And the last question should have been: Can I say what processes are running in the background (only the last one run is in $apid) and is it possible to get them back to foreground? R. 2008/6/20 Rudolf Sykora : > Hello, > > is there any simple way how to identify processes belonging to one concrete > process group? > > Is there any simple way how to change a process' group? > > Is there anything like pstree in plan9? > > Thanks > Ruda > ------=_Part_10051_10728496.1213977015068 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline And the last question should have been:

Can I say what processes are running in the background (only the last one run is in $apid) and is it possible to get them back to foreground?

R.

2008/6/20 Rudolf Sykora <rudolf.sykora@gmail.com>:
Hello,

is there any simple way how to identify processes belonging to one concrete process group?

Is there any simple way how to change a process' group?

Is there anything like pstree in plan9?

Thanks
Ruda

------=_Part_10051_10728496.1213977015068-- From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: To: 9fans@9fans.net Date: Fri, 20 Jun 2008 15:08:24 -0400 From: a@9srv.net In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: Re: [9fans] process group, processes running in the background Topicbox-Message-UUID: c3e2933a-ead3-11e9-9d60-3106f5b1d025 // Can I say what processes are running in the background... I assume you mean in the shell (the rest of your questions were more general). rc tracks this internally for wait to work (which will allow you to wait for a given pid or all backgrounded pids) in waitpids in /sys/src/cmd/rc/plan9.c, but i don't see that the contents of this are exposed to users anywhere. If one were sufficently motivated, it looks like it'd be fairly straight- forward to add an env var, say apidlist, and have the *waitpid fns in plan9.c manipulate it. // ...is it possible to get them back to foreground? Nope. anthony From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Message-id: From: Pietro Gagliardi To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> In-reply-to: Date: Fri, 20 Jun 2008 15:10:25 -0400 References: Subject: Re: [9fans] process group, processes running in the background Topicbox-Message-UUID: c3e6d274-ead3-11e9-9d60-3106f5b1d025 On Jun 20, 2008, at 10:03 AM, Rudolf Sykora wrote: > Hello, > > is there any simple way how to identify processes belonging to one > concrete process group? They're called "note groups" and the noteid file of each process has the number. So if you call 6 lines of rc and 5 lines of awk simple, then yes! { for(i in /proc/*) if(! ~ $i /proc/trace) echo `{cat $i/noteid}:`{basename $i} } | sort -t: -n | awk ' # based on squash by jon bentley from programming pearls 1st edition BEGIN { FS = ":" } $1 != prev { prev = $1; if(NR > 1) printf "\n"; printf "%d: ", $1 } { printf "%d ", $2 } END { printf "\n" } ' > Is there anything like pstree in plan9? Work with the code I gave you and /sys/src/cmd/ps.c. Pietro From mboxrd@z Thu Jan 1 00:00:00 1970 From: erik quanstrom Date: Fri, 20 Jun 2008 15:17:21 -0400 To: a@9srv.net, 9fans@9fans.net Message-ID: <8ca0d10db61015ee4543655a456bea74@coraid.com> In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: Re: [9fans] process group, processes running in the background Topicbox-Message-UUID: c3eb7590-ead3-11e9-9d60-3106f5b1d025 > If one were sufficently motivated, it looks like it'd be fairly straight- > forward to add an env var, say apidlist, and have the *waitpid fns in > plan9.c manipulate it. byron's rc does this. the variable is called $apids. i don't recall ever wanting for this feature in rc. - erik From mboxrd@z Thu Jan 1 00:00:00 1970 To: 9fans@9fans.net Subject: Re: [9fans] process group, processes running in the background From: "Russ Cox" Date: Fri, 20 Jun 2008 15:58:31 -0400 In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Message-Id: <20080620195755.5C1551E8C22@holo.morphisms.net> Topicbox-Message-UUID: c3ef80ea-ead3-11e9-9d60-3106f5b1d025 There is no "job control" in Plan 9. Instead, there is a window system. Draw two windows, and run one command in each. Then it is very easy to bring one or the other command to the foreground by clicking with the mouse in the associated window. Russ P.S. Processes by group: for(i in `{grep . /proc/*/noteid | sed 's!.*:!!' | sort -nu}){ echo $i ps | grep -f <{ grep -l ' '$i' ' /proc/*/noteid >[2]/dev/null | sed 's!/proc/!^[^ ]+ +!; s!/noteid! !' } } From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: Date: Sat, 21 Jun 2008 14:40:50 +0200 From: "Rudolf Sykora" To: "Fans of the OS Plan 9 from Bell Labs" <9fans@9fans.net> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_5478_27255187.1214052050707" References: Subject: Re: [9fans] process group, processes running in the background Topicbox-Message-UUID: c3f78394-ead3-11e9-9d60-3106f5b1d025 ------=_Part_5478_27255187.1214052050707 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Thanks for everybody's answers... :) R. 2008/6/20 Pietro Gagliardi : > On Jun 20, 2008, at 10:03 AM, Rudolf Sykora wrote: > > Hello, >> >> is there any simple way how to identify processes belonging to one >> concrete process group? >> > > They're called "note groups" and the noteid file of each process has the > number. So if you call 6 lines of rc and 5 lines of awk simple, then yes! > > { > for(i in /proc/*) > if(! ~ $i /proc/trace) > echo `{cat $i/noteid}:`{basename $i} > } | sort -t: -n | awk ' > # based on squash by jon bentley from programming pearls 1st edition > BEGIN { FS = ":" } > $1 != prev { prev = $1; if(NR > 1) printf "\n"; printf "%d: ", $1 } > { printf "%d ", $2 } > END { printf "\n" } > ' > > Is there anything like pstree in plan9? >> > Work with the code I gave you and /sys/src/cmd/ps.c. > > Pietro > > > ------=_Part_5478_27255187.1214052050707 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Thanks for everybody's answers... :)
R.

2008/6/20 Pietro Gagliardi <pietro10@mac.com>:
On Jun 20, 2008, at 10:03 AM, Rudolf Sykora wrote:

Hello,

is there any simple way how to identify processes belonging to one concrete process group?

They're called "note groups" and the noteid file of each process has the number. So if you call 6 lines of rc and 5 lines of awk simple, then yes!

{
       for(i in /proc/*)
               if(! ~ $i /proc/trace)
                       echo `{cat $i/noteid}:`{basename $i}
} | sort -t: -n | awk '
# based on squash by jon bentley from programming pearls 1st edition
BEGIN { FS = ":" }
$1 != prev { prev = $1; if(NR > 1) printf "\n"; printf "%d: ", $1 }
{ printf "%d ", $2 }
END { printf "\n" }

'

Is there anything like pstree in plan9?
Work with the code I gave you and /sys/src/cmd/ps.c.

Pietro



------=_Part_5478_27255187.1214052050707--