in reply to Re^2: Address Bind issue reincarnation
in thread Address Bind issue reincarnation

You had mentioned about inetd. I have started reading about it. But, will it help me make a daemon process for my script.

Just to avoid misunderstandings: don't use inetd if you have xinetd.  Essentially, they serve the same purpose, but xinetd is the more modern, more secure incarnation. — I just linked to inetd, because the respective wikipedia page for xinetd didn't have the crucial bit of info about stdin/stdout...

P.S.: in case you want to run your script persistently as a regular standalone daemon (not managed by xinetd, thus doing networking itself), you might be interested in daemontools.  In this case, you'd have to add an accept loop to your script, though.

Replies are listed 'Best First'.
Re^4: Address Bind issue reincarnation
by sajanagr (Acolyte) on Jul 19, 2010 at 05:43 UTC
    Hi almut,

    I wished to use xinetd first, but since my server code i wrote is using socket functions, so the communication is not through stdin/stdout which brings me to the 'Address bind' issue

    I am trying another approach of making a standalone daemon. The goal is to make a server daemon listening to a port continuously.

    I read the links you sent me, thanks a lot. I am thinking now to make a script in /etc/init.d/ and define a run level for it. What do you say?

      I am thinking now to make a script in /etc/init.d/ and define a run level for it.

      Sounds like a good plan :)   (in case you don't want to use daemontools for some reason, that is)

      See runlevel if you need ideas on which one to choose.

        Hi almut,

        I wanted to have a proper control of my server code to stop and start the server daemon. Using daemontools, I came to know that I can keep my command in rc.local, but that is no better control of the daemon as per my understanding.

        I made a script in init.d to start, stop, restart and to check the status of my daemon.

        It would had been great if I could had used xinetd, but this is a lightweighted code anywayz.

        thanks for the support