1

I'm using GNU's Inetutils FTP and have gotten it all set up except it does not automatically start when I turn on my system. In order to get it to work I have to start the standalone using "ftpd -D". I've figured out that I have xinetd running and I believe I need to use that to automatically start the daemon.

In the /etc/xinetd.d/ directory I've added a file named 'ftp'. Inside its contents are:

service ftpd
{
    socket_type = stream
    protocol = tcp
    wait = no
    user = root
    server = /usr/bin/ftpd
    instances = 20
}

*Doing a whereis shows that ftpd resides in /usr/bin/ftpd*

After adding it I reloaded the configuration and restarted the server.

/etc/init.d/xinetd reload
/etc/init.d/xinetd restart

My xinetd.conf file is as followed:

# Simple configuration file for xinetd
#
# Some defaults, and include /etc/xinetd.d/

defaults
{
    instances           = 60
    log_type            = SYSLOG authpriv
    log_on_success      = HOST PID
    log_on_failure      = HOST
    cps                 = 25 30
}

includedir /etc/xinetd.d

There was also an inetd.config file in my system so I added the following for good measure though it doesn't seem inetd is running.

ftp     stream  tcp     nowait  root    /usr/bin/ftpd   in.ftpd -l -a

When I try to connected to my ftp server I get the error "ECONNREFUSED - Connection refused by server". Does anyone have any idea why this isn't getting started automatically by xinetd?

I got my information from this website: http://www.cyberciti.biz/faq/linux-how-do-i-configure-xinetd-service/

3
  • Are you sure inetd (or xinetd) is running and not reporting errors when it starts? Connection refused would seem to indicate that it isn't. Also, use lsof to see if it's listening on the FTP port.
    – Celada
    Jun 3, 2015 at 17:41
  • Using 'ps -ef | grep xinetd' shows that it is started, though I don't see it logging anything. (root 1625 1 0 22:28 ? 00:00:00 /usr/sbin/xinetd -pidfile /var/run/xinetd.pid -stayalive) Jun 3, 2015 at 17:49
  • It might be worth mentioning that sytemd changes things, AFAICT, with regards to how the vsftpd process gets forked.
    – ILMostro_7
    Oct 3, 2017 at 15:55

2 Answers 2

2

I figured it out. Incase anyone else has this problem in the future, I forgot to specify a port to use for the service, changed the service name to ftp and set disable to no. Here is my final service file:

service ftp
{
    port = 21
    disable = no
    socket_type = stream
    protocol = tcp
    wait = no
    user = root
    server = /usr/bin/ftpd
    instances = 20
}

To get the logging working I used the following command:

/usr/sbin/xinetd -filelog /var/log/xinetd -f /etc/xinetd.conf
1
  • For anyone coming in much later usually port and protocol for common servers are defined in /etc/services. If that file is missing in some custom distro like Yocto, usually the package is called netbase.
    – davolfman
    Jan 20, 2021 at 18:04
1

service (ftp)=> you can see the service name on c:/services file please check

{
    port = 21
    disable = no
    socket_type = stream
    protocol = tcp
    wait = no
    user = root
    server = /usr/bin/ftpd
    instances = 20
}
2
  • 2
    c:/services ??
    – Jeff Schaller
    Nov 7, 2016 at 13:50
  • si, servicios! Claro
    – ILMostro_7
    Oct 3, 2017 at 15:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .