starting Perl script from inetd
Trying to start a Perl smtp(port 25) server from inetd.
Script works OK as stand alone but fails to start from inetd.
(In fact this has reached you through the same code, but running on a
different port)
Question 1: Is there a way to log inetd?
Question 2: should the server be started differently for inetd (as
compared to a standalone server)
Some of the stuff I have looked at so far:
-- line from /etc/inetd . . .
smtp stream tcp nowait root /usr/local/bin/msmtp
-- upon attempting to send mail from MUA (mozilla mail), fails
immediately saying "Unable to connect to SMTP server 'localhost'"
netstat shows . . .
:~> netstat -ntalc | grep ':25'
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:33052 127.0.0.1:25 CLOSE_WAIT
tcp 0 0 127.0.0.1:25 127.0.0.1:33052 FIN_WAIT2
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:33052 127.0.0.1:25 CLOSE_WAIT
tcp 0 0 127.0.0.1:25 127.0.0.1:33052 FIN_WAIT2
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN
-- upon attempting to telnet to port 25 . . .
:~> telnet localhost 25
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Failed to start server :Address already in use
(in cleanup) Can't call method "close" on an undefined value at
/usr/lib/perl5/site_perl/5.6.1/Net/SMTP/Server.pm line 55.
Connection closed by foreign host.
netstat shows . . .
:~> netstat -ntalc | grep ':25'
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:33069 127.0.0.1:25 ESTABLISHED
tcp 0 0 127.0.0.1:25 127.0.0.1:33069 ESTABLISHED
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:25 127.0.0.1:33069 TIME_WAIT
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN
-- some of different ways I have tried to start the server
my $srv = new Net::SMTP::Server( 'localhost', 25 )
my $srv = new Net::SMTP::Server( '0.0.0.0', 25 )
my $srv = new Net::SMTP::Server( , 25 )
my $srv = new Net::SMTP::Server( )
none have behaved any differently
Thanks
Reply to: