20
3
in a Linux environment, I need to kill a process which has been started by user2 if I am user1 without being sudoers or using root. Do you know if there is a way of setting that when launching the process? Such as a list of users allowed to kill the process?
The fact is that concurrent instances of the same process can be started from different users, that is why it is not convenient for me to set the group id to the process. Other users that are not in the group will not be able to start a second parallel process.
What I have is a list of users allowed to start the process, defined in the database, before starting the process I check that the current user in the list and, if yes, I start the process with the current user. If a second user allowed to do that wants to kill the process I'd like it to be allowed to do that but I don't want it to be sudoers.
Therefore, I was thinking to create a process running as root which receives the request to kill processes from a user, checks if the user is allowed to start/stop the process and kills the process.
Do you think it could be the best solution?
Welcome to SO. I don't think this is possible... Anyway, this is more suitable for SO's sister site, serverfault.com. It may get migrated there soon, no need to do anything. – Pekka – 2010-05-03T12:18:30.567
What kind of program are we talking about? It would be difficult in the general case, but in some cases (such as apache or an app that you can modify yourself) it would be easier. – Kim – 2010-05-03T12:23:02.547