Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to restrict a process from changing it's process group? For example, user nobody seems to be able to call setpgid(0, 0) which sets process group of current process to pid of that process. (setpgid(0, non-zero-number) is denied, however).

share|improve this question

I doubt that the outcome of achieving this would be what you would expect, and it would have a negative impact your system, rather than a positive one, with potentially negative impacts on signal handling and terminal I/O.

In fact, there are restrictions on the process group IDs that are allowed to be set, in most cases the controlling tty's process group ID, which is why not being able to set it would have negative impacts on signal handling and terminal I/O. This is a security benefit

Here's a good reference on process groups: http://www.cs.ucsb.edu/~almeroth/classes/W99.276/assignment1/signals.html#Pgrps

You may get a good answer asking this on stackoverflow.com, too.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.