Found the answer. the problem was the stdio caching. set it to auto flush, and it works fine. Took me long enough to find it. | [reply] |
in case anyone was wondering, to use xinetd to act as a super server for your code, you need to add the following kind of thing to a new file (call it what you want to. I'd suggest something descriptive) in /etc/xinetd.d/
service servermon
{
disable = no
socket_type = stream
wait = no
user = root
instances = 3
server = /home/backup/servermon/monitord.pl
log_on_failure += USERID
}
and the following kind of line at the bottom of /etc/services
servermon 2345/tcp
(the name of the service has to match the name in ect services, or you have to give more details.man xinetd.conf is fairly explanetory)
then your program just has to read and write to stdin and stdout. (stderr is also redirected.) The bit that caught me was, you need to make sure that stdio is flushing its cache. $|=1; will do this for you. | [reply] [d/l] [select] |
oops, forgot to log in. This one's mine. | [reply] |