Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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
add comment

1 Answer

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
add comment

Your Answer

 
discard

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.