[vox-tech] running service as a different user

vox-tech@lists.lugod.org vox-tech@lists.lugod.org
Tue, 9 Jul 2002 14:10:45 -0400


On Tue, Jul 09, 2002 at 10:46:25AM -0700, Jan Wynholds wrote:
> Can't you use xinetd?  I think it might be what you're looking for.

Jan,

  That is a good concept (using inetd to start services) but I
don't think it will work in this case, for this type of server.

  I don't know if this post contains enough detail, but I'm in a hurry.


A server process has to be written to handle that.  There are
generally two types of server processes:
- ones that stay running all the time and are started at bootup.
  typically they maintain state from session to session, are designed to
  handle multiple connections at the same time, and bind their own ports.
- ones that only handle one request at a time and are started by inetd
  when a connection attempt comes in and exit after the request is 
  complete, these use stdin/stdout.

  Since there are some steps required to bind a socket for incoming
connections if you are running stand alone and you just use stdin/stdout
if you are started from inetd, the server process has to be coded
to pick an operating mode (maybe based on command line options).

  Some daemons are built to operate in both modes (can be run from inetd
or from init scripts)... sshd is an example.  Some operate in only inetd
mode (like telnetd), and some only operate in stand alone (jabberd
appears to be one of these).

  Anyway if I understand the purpose of jabberd it doesn't make sense
to operate from inetd.  It is a text message passing daemon for people,
so in order to be useful you need multiple clients connected to it to
be able to pass text messages between them.
  If the process is started by inetd, you would get one server process
per client connection, and while you might have 50 people connected
they each would have no one else to talk to.

    TTFN,
      Mike