can't connect to ftp server

Matthew Seaman m.seaman at infracaninophile.co.uk
Wed Feb 18 02:26:22 PST 2004


On Tue, Feb 17, 2004 at 04:34:04PM -0500, Marty Landman wrote:

> Something related which I'd like to understand Matthew. I don't know what 
> the base install ftpd is as
> 
> # /usr/libexec/ftpd -V
> ftpd: illegal option -- V
> ftpd: unknown flag -V ignored
> # /usr/libexec/ftpd -v
> #
> 
> However I installed wu-ftpd from the ports yesterday and it's in 
> /usr/local/libexec/ftpd so I changed /etc/inetd.conf accordingly and then 
> did
> 
>  kill -HUP `cat /var/run/inetd.pid`
> 
> and for laughs (or developing the understanding now that navigating unix is 
> similar to driving in New Jersey) I tried ftp'g into my box w/o first 
> (starting) inetd and I got in, and ps -ax showed inetd running as well. Yet 
> I don't see in the man pages for inetd(8) where any of these options imply 
> automatic restart.

There's two ways of running ftpd(8) -- either out of inetd(8) or as a
standalone process.  Some software packages will do one, some will do
the other and several will do both given the correct configuration.

The system ftpd(8) assumes that it is going to be run out of inetd(8)
-- which means that inetd(8) is going to do all the grunt work of
receiving any incoming connection and then fire up ftpd(8) with it's
standard in- and outputs already connected to the network socket.  If
you try and start a daemon designed to work with inetd from the
command line, as you showed, it will either sit there waiting for
input on stdin or close down immediately.

Most of the other FTP server ports are intended to run standalone --
that is the ftpd process runs continually and manages all of the
incoming connections to port 21 itself.  Generally running these
daemons from the command line will look as if they just shut down
immediately, but actually what happens is that they 'daemonized'
themselves: ie. spawn another copy of themselves, which isn't
associated with any terminal (plus various other changes -- see
daemon(3), setsid(2) for details).

You won't be able to run both inetd(8) providing FTP service and a
standalone FTP daemon -- only one process at a time can take control
of the FTP port on your system.  However, most system level programs
like this don't print out error messages on the command line --
rather, they use syslog(3) to write the errors into the system log
files.  However there isn't any obvious notification to you typing at
the console if this sort of thing occurs -- you'll just find that some
process you expected to be running isn't and have to go hunting
through the log files to work out why.

Running ftpd out of inetd is generally appropriate for low-traffic FTP
sites or sites where FTP access is only required occasionally.  A
stand-alone FTPd setup would be more appropriate for a machine tasked
with being a full-time FTP server.

	Cheers,

	Matthew

-- 
Dr Matthew J Seaman MA, D.Phil.                       26 The Paddocks
                                                      Savill Way
PGP: http://www.infracaninophile.co.uk/pgpkey         Marlow
Tel: +44 1628 476614                                  Bucks., SL7 1TH UK
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20040218/e3804318/attachment.bin


More information about the freebsd-questions mailing list