Delievering signals to daemon process - Unix

This is a discussion on Delievering signals to daemon process - Unix ; Hello all I have written a chat server. It is invoked as follows - $ ./server -start It becomes a daemon. I want to implement a stop call- $ ./server -stop The approach I am following is to write the ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: Delievering signals to daemon process

  1. Delievering signals to daemon process

    Hello all

    I have written a chat server. It is invoked as follows -
    $ ./server -start
    It becomes a daemon. I want to implement a stop call-
    $ ./server -stop
    The approach I am following is to write the PID of the running server
    in a flat file when server starts. When it needs to be stopped,
    kill(SIGUSR1, pid) is sent to the server. The signal handler closes
    all the open sockets and exits.

    Your suggestions and alternate ways to accomplish it are welcome.

    Regards,
    Rahul

  2. Re: Delievering signals to daemon process

    In article
    <3a8a80db-d916-4b15-811c-7caaa9ca94d0@l32g2000hse.googlegroups.com>,
    rahulsinner@gmail.com wrote:

    > Hello all
    >
    > I have written a chat server. It is invoked as follows -
    > $ ./server -start
    > It becomes a daemon. I want to implement a stop call-
    > $ ./server -stop
    > The approach I am following is to write the PID of the running server
    > in a flat file when server starts. When it needs to be stopped,
    > kill(SIGUSR1, pid) is sent to the server. The signal handler closes
    > all the open sockets and exits.
    >
    > Your suggestions and alternate ways to accomplish it are welcome.
    >
    > Regards,
    > Rahul


    See the responses in comp.unix.programmer, where it was on-topic. If
    you really MUST post to multiple groups, cross-post, don't multi-post.
    But why would you think that this question about programming should be
    posted anywhere other than comp.unix.programmer?

    --
    Barry Margolin, barmar@alum.mit.edu
    Arlington, MA
    *** PLEASE post questions in newsgroups, not directly to me ***
    *** PLEASE don't copy me on replies, I'll read them in the group ***

+ Reply to Thread