kill -TERM to a process owned by postgres - Unix

This is a discussion on kill -TERM to a process owned by postgres - Unix ; Hi. I have a collection of database maintenance scripts that often have the need to terminate certain database connections. This could be achieved easily with kill -TERM , using the PIDs associated with the connections, but irrespective of the Unix ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: kill -TERM to a process owned by postgres

  1. kill -TERM to a process owned by postgres




    Hi. I have a collection of database maintenance scripts that often
    have the need to terminate certain database connections. This
    could be achieved easily with kill -TERM , using the PIDs
    associated with the connections, but irrespective of the Unix user
    who initiated the connections, the resulting Unix process is owned
    by the special user postgres.

    Is there a way whereby a user could grant another user the permission
    to terminate its processes?

    TIA!

    Kynn

    --
    NOTE: In my address everything before the first period is backwards;
    and the last period, and everything after it, should be discarded.

  2. Re: kill -TERM to a process owned by postgres

    kj writes:
    > Hi. I have a collection of database maintenance scripts that often
    > have the need to terminate certain database connections. This
    > could be achieved easily with kill -TERM , using the PIDs
    > associated with the connections, but irrespective of the Unix user
    > who initiated the connections, the resulting Unix process is owned
    > by the special user postgres.
    >
    > Is there a way whereby a user could grant another user the permission
    > to terminate its processes?


    Yes, by using a 'suitable' setuid-program.

  3. Re: kill -TERM to a process owned by postgres

    kj wrote:

    > Hi. I have a collection of database maintenance scripts that often
    > have the need to terminate certain database connections. This
    > could be achieved easily with kill -TERM , using the PIDs
    > associated with the connections, but irrespective of the Unix user
    > who initiated the connections, the resulting Unix process is owned
    > by the special user postgres.
    >
    > Is there a way whereby a user could grant another user the permission
    > to terminate its processes?


    Only by arranging for the processes involved to have suitable
    user IDs. POSIX says:

    "For a process to have permission to send a signal to [another]
    process [...] the real or effective user ID of the sending process
    shall match the real or saved set-user-ID of the receiving process."

    --
    Geoff Clare

+ Reply to Thread