01-15-2008
allowing members of a group to kill a process
I've written a python program where I want to allow members of a specific group the ability to kill it, and I'm not sure how to do it. I've been looking at the setuid() and setgid() and similar functions in the os module, but haven't been able to get them to work. I can't seem to change the uid or gid of the running process at all.
I currently don't have any sudo permissions.
Anyone have a good idea of how to do this? I was thinking of having a couple wrapper scripts that would start/kill the process where they would use the setuid/setgid() functions, but as of yet to no avail.
Thanks
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I know there is a "groups" command to list the groups a user belongs to, but how about the opposite? Is there a standard command to find out which users belong to a particular group? (2 Replies)
Discussion started by: ovaska
2 Replies
2. UNIX for Advanced & Expert Users
Hi All,
I am unable to kill a process using kill command. I am using HP-UX system. I have tried with kill -9 and i have root privilages.
How can i terminate this daemon ? ? ?
Regards,
Vijay Hegde (3 Replies)
Discussion started by: VijayHegde
3 Replies
3. Solaris
Hello Sir,
I want to add some members into a group on NIS domain, but when I run "/usr/ccs/bin/make group" to update the group map it was failed :-(
the error message is :
problem storing develop... (4 Replies)
Discussion started by: lk74612
4 Replies
4. Shell Programming and Scripting
Is there a command to get a list of group members? Something similar to the groups command, but instead of passing a username and returning groups, you pass it a groupname, and it returns members?
It is difficult to do it manually because the group membership information is split across two... (5 Replies)
Discussion started by: akbar
5 Replies
5. Shell Programming and Scripting
Hey
I'm writing a script that creates some processes,and some scripts which kill those processes.
the question is Simply:
How can I allow a group members to be able to kill (using kill command) processes created by other user at the same group?
and i need the change to be at the script... (5 Replies)
Discussion started by: The Dark Knight
5 Replies
6. AIX
Hey
I'm writing a script that creates some processes,and some scripts which kill those processes.
the question is Simply:
How can I allow group members to be able to kill processes created by other member at the same group?
I need your help as soon as possible
Thanks for your help in... (4 Replies)
Discussion started by: The Dark Knight
4 Replies
7. Linux
Hi all,
I am new to Linux.Can anyone tell me how to display or list all the members in a group?
Thanks in advance. (9 Replies)
Discussion started by: arthi
9 Replies
8. Solaris
Hi,
I already gone through with old post regarding listing the group members and tried the command
getenv group other
the result is
other::1:root
i listed my part of the /etc/passwd file below
test1:x:100:1::/home/test1:/bin/sh
test2:x:101:1::/home/test2:/bin/ksh... (7 Replies)
Discussion started by: vr_mari
7 Replies
9. Shell Programming and Scripting
Good afternoon
I need to KILL a process in a single command sentence, for example:
kill -9 `ps -aef | grep 'CAL255.4ge' | grep -v grep | awk '{print $2}'`
That sentence Kills the process ID corresponding to the program CAL255.4ge.
However it is possible that the same program... (6 Replies)
Discussion started by: enriquegm82
6 Replies
10. UNIX for Advanced & Expert Users
Hi!
I created a group HACKERS and made the user "demo" its member.
$ id demo
uid=500(demo) gid=500(demo) groups=500(demo),502(HACKERS)
$
Next, I granted read and execute permissions to the group "HACKERS" on /var/log/httpd as shown below:
setfacl -m "g:HACKERS:r-x"... (2 Replies)
Discussion started by: indiansoil
2 Replies
KILL(2) BSD System Calls Manual KILL(2)
NAME
kill -- send signal to a process
SYNOPSIS
#include <signal.h>
int
kill(pid_t pid, int sig);
DESCRIPTION
The kill() function sends the signal specified by sig to pid, a process or a group of processes. Typically, Sig will be one of the signals
specified in sigaction(2). A value of 0, however, will cause error checking to be performed (with no signal being sent). This can be used
to check the validity of pid.
For a process to have permission to send a signal to a process designated by pid, the real or effective user ID of the receiving process must
match that of the sending process or the user must have appropriate privileges (such as given by a set-user-ID program or the user is the
super-user). A single exception is the signal SIGCONT, which may always be sent to any descendant of the current process.
If pid is greater than zero:
Sig is sent to the process whose ID is equal to pid.
If pid is zero:
Sig is sent to all processes whose group ID is equal to the process group ID of the sender, and for which the process has permission;
this is a variant of killpg(2).
If pid is -1:
If the user has super-user privileges, the signal is sent to all processes excluding system processes and the process sending the
signal. If the user is not the super user, the signal is sent to all processes with the same uid as the user, excluding the process
sending the signal. No error is returned if any process could be signaled.
For compatibility with System V, if the process number is negative but not -1, the signal is sent to all processes whose process group ID is
equal to the absolute value of the process number. This is a variant of killpg(2).
RETURN VALUES
Upon successful completion, a value of 0 is returned. Otherwise, a value of -1 is returned and errno is set to indicate the error.
ERRORS
Kill() will fail and no signal will be sent if:
[EINVAL] Sig is not a valid, supported signal number.
[EPERM] The sending process is not the super-user and its effective user id does not match the effective user-id of the receiving
process. When signaling a process group, this error is returned if any members of the group could not be signaled.
[ESRCH] No process or process group can be found corresponding to that specified by pid.
[ESRCH] The process id was given as 0, but the sending process does not have a process group.
SEE ALSO
getpgrp(2), getpid(2), killpg(2), sigaction(2)
STANDARDS
The kill() function is expected to conform to IEEE Std 1003.1-1988 (``POSIX.1'').
4th Berkeley Distribution April 19, 1994 4th Berkeley Distribution