Re: Assigning group or effective group to processes

2009-01-29 Thread Alexander Hall

Lars Noodin wrote:

I have a bunch of processes that I wish to kill, but which have the same
name and owner as process I wish to leave running.
ps, pgrep and pkill can select based on a process' gid or egid.

How can gid or egid be set when starting a process from shell?


sudo(8)?



Re: Assigning group or effective group to processes

2009-01-29 Thread Janusz Gumkowski
On Thu, Jan 29, 2009 at 01:59:55PM +0100, Alexander Hall wrote:
 Lars Noodin wrote:
 I have a bunch of processes that I wish to kill, but which have the same
 name and owner as process I wish to leave running.
 ps, pgrep and pkill can select based on a process' gid or egid.
 
 How can gid or egid be set when starting a process from shell?
 
 sudo(8)?
 

chroot might be easier:

# chroot -g nobody,wsrc -u bin / /usr/bin/id
uid=3(bin) gid=32767(nobody) groups=32767(nobody), 9(wsrc)



-- 
Janusz Gumkowski
http://www.am.torun.pl/~ja



Re: Assigning group or effective group to processes

2009-01-29 Thread Philip Guenther
On Wed, Jan 28, 2009 at 2:44 AM, Lars Noodin larsnoo...@openoffice.org
wrote:
 I have a bunch of processes that I wish to kill, but which have the same
 name and owner as process I wish to leave running.
 ps, pgrep and pkill can select based on a process' gid or egid.

 How can gid or egid be set when starting a process from shell?

The command you're looking for is 'newgrp'...which OpenBSD doesn't
currently have.  sudo is probably the most direct workaround for now.


Philip Guenther



Re: Assigning group or effective group to processes

2009-01-29 Thread Lars Noodén
Philip Guenther wrote:
 On Wed, Jan 28, 2009 at 2:44 AM, Lars Noodin larsnoo...@openoffice.org
 How can gid or egid be set when starting a process from shell?
 
 The command you're looking for is 'newgrp'...which OpenBSD doesn't
 currently have.  sudo is probably the most direct workaround for now.

Ok.  Thanks, I was looking for newgrp (or something like it) but hoping
that it merely had a different name.

sudo it must be then.

Regards,
-Lars



Assigning group or effective group to processes

2009-01-28 Thread Lars Noodén
I have a bunch of processes that I wish to kill, but which have the same
name and owner as process I wish to leave running.
ps, pgrep and pkill can select based on a process' gid or egid.

How can gid or egid be set when starting a process from shell?

Regards,
-Lars