George Gallen on 11 Nov 2004 14:17:02 -0000


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

RE: [PLUG] setting up a socket service...


Title: RE: [PLUG] setting up a socket service...

>-----Original Message-----
>From: plug-admin@lists.phillylinux.org
>[mailto:plug-admin@lists.phillylinux.org]
>Sent: Wednesday, November 10, 2004 7:15 PM
>To: plug@lists.phillylinux.org
>Subject: Re: [PLUG] setting up a socket service...
>
>
>I'm going to go out on a limb and ask what this is for. The reason I
>ask is that, with the above description, two things are evident:

I have a system connected via a SLIP connection (so DOS isn't an issue)
in our fullfillment warehouse. They run a program on our system that
produces mailing labels. There is also a scale at their facility.
I have a program that reads the weight of the scales and returns the
numeric information. From our system I want to be able to run this command.
Yes, I could use rsh to run the command, but I want to set it up as
a service, well...., well because I may want to add to it's functionality
in the future, and it will already be setup as a service.

>
>1. Its quite easy to monopolize and DoS this service.
>2. Are you _SURE_ you want clients to connect and send commands? Why
>isn't RPC good enough for this?
>
>Having said that:
>
>daemontools is an excellent solution for creating arbitrary network
>services easily. The daemonization and respawning are handled by
>daemontools, as is log rotation and expiry via multilog. Check out
>http://cr.yp.to/daemontools.html for more information on that software.
>
>Alternatively, you could run the program under xinetd by simply adding
>a file in /etc/xinetd.d. Here's an example:
>
># cat > /etc/xinetd.d/yourservice <<EOF
>service yourservice
>{
>       type                    = INTERNAL UNLISTED
>       id                      = yourservice-stream
>       socket_type     = stream
>       protocol                = tcp
>       user                    = root
>       wait                    = yes
>       server          = /usr/local/bin/yourservicebinary
>       server-args     = --some-kind-of-argument
>       only_from               = 127.0.0.1
>}
>EOF

I looked at xinetd (which was my preference), but I didn't see how you
set the listening port value...musthave missed it in the docs, I'll have
to re-read it.

>
>xinetd.conf(5) has all the specifics on what goes where in this file.
>Yours will probably look like the above somewhat. Check out the
>existing files for examples, too.
>
>- --
>Tobias DiPasquale

George

>