LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 03-18-2004, 04:51 PM   #1
jimi_j
Member
 
Registered: Jan 2004
Distribution: CentOS
Posts: 30

Rep: Reputation: Disabled
FTP & xinetd


Hi there,

i have a problem where on re-boot of our RH9 server the ProFTPD server is unable to start because xinetd hogs port 21, i have to stop xinetd - start FTP - then restart xinetd, any ideas as to why this might be happening?

cheers
 
Old 03-20-2004, 06:17 AM   #2
/bin/bash
Senior Member
 
Registered: Jul 2003
Location: Indiana
Distribution: Mandrake Slackware-current QNX4.25
Posts: 1,802

Rep: Reputation: 46
Look in the /etc/xinetd.conf file for a line like this
include /etc/xinetd.d
If you have that line then look in the /etc/xinetd.d directory for any ftp file like wu-ftpd. If you have one then edit the file and disable the service.
disable = yes
 
Old 03-22-2004, 04:55 PM   #3
jimi_j
Member
 
Registered: Jan 2004
Distribution: CentOS
Posts: 30

Original Poster
Rep: Reputation: Disabled
Thanks for the reply /bin/bash

I do have a line in the /etc/xinetd.conf referring to a includedir which is /etc/xinetd.d as you say.

However there is no mention of ftp in any of the files present in the includedir, i looked thru them all and checked for hidden ones.

i did notice that the xinetd.conf file is rather small and and apart from a small section on defaults and the includedir there is a section that refers to the ProFTP service as follows;

{
port = 21
socket_type = stream
protocol = tcp
user = root
server = /usr/local/sbin/in.proftpd
type = UNLISTED
wait = no
}

Any further suggestions much appreciated.
 
Old 03-23-2004, 04:00 PM   #4
/bin/bash
Senior Member
 
Registered: Jul 2003
Location: Indiana
Distribution: Mandrake Slackware-current QNX4.25
Posts: 1,802

Rep: Reputation: 46
If proftpd is also being started with the init-scripts then this is probably your problem. Try this:
Code:
chkconfig --list proftpd
proftpd         0:off   1:off   2:off   3:on    4:off   5:on    6:off
If you get anything like this, then it will probably be safe to edit the xinetd.conf file and remove the proftpd entry and let the init-scripts start the server.
 
Old 03-24-2004, 06:38 PM   #5
jimi_j
Member
 
Registered: Jan 2004
Distribution: CentOS
Posts: 30

Original Poster
Rep: Reputation: Disabled
thanks for the reply once again .

the cmd chkconf --list proftpd returns a no such file or directory error, chkconf --list on its own shows a big list of services but alas, proftpd is not one of them. Service proftpd returns a unrecognized service error, and to start the service i have to use Webmin. i also noticed that the only running processes that webmin is reporting is the proftpd processID and that its parent process is init. i did edit the xinetd.conf file but once again proftpd wouldn't start on re-boot so Ive reversed those changes and are back at square one. i noticed in Webmin that the proftpd server is set to start automatically using the Internet services module but when looking at the setup within that module can see that it is being palmed off to in.proftpd [in. I assume stands for init] as opposed to the option of having the service handled by xinetd, i will try changing this option unless you have any further suggestions?

thanking you, and i like the signature
 
Old 03-25-2004, 08:30 PM   #6
/bin/bash
Senior Member
 
Registered: Jul 2003
Location: Indiana
Distribution: Mandrake Slackware-current QNX4.25
Posts: 1,802

Rep: Reputation: 46
Can you just do a ps -ax after you boot and see if it is actually proftp that is using port 21. Also a netstat -ta should tell you if anything is listening on port 21.
 
Old 03-29-2004, 04:02 PM   #7
jimi_j
Member
 
Registered: Jan 2004
Distribution: CentOS
Posts: 30

Original Poster
Rep: Reputation: Disabled
hi /bin/bash, soz i've taken a few days to reply - things went crazy round here.

the ps -ax cmd shows that proftpd is not started after a re-boot.

netstat -ta shows local address *:ftp & nothing else that i can see listening on port 21, i tried the switch -antp & that shows xinetd listening on port 21 & on port 110 - unfortunately im not sure what all this means...?

thanks...
 
Old 04-03-2004, 11:46 AM   #8
VincentB
Member
 
Registered: Jun 2003
Location: Brussels, Belgium
Distribution: Ubuntu 6.10
Posts: 139

Rep: Reputation: 15
I had the same problem.

Apr 1 19:02:25 sun proftpd[3802]: sun.xxxx.be - Failed binding to 0.0.0.0, port 21: Address already in use
Apr 1 19:02:25 sun proftpd[3802]: sun.xxxx.be - Check the ServerType directive to ensure you are configured correctly.

[root@sun xinetd.d]# netstat -tanp
Connexions Internet actives (serveurs et établies)
Proto Recv-Q Send-Q Adresse locale Adresse distante Etat PID/Program name
tcp 0 0 127.0.0.1:32768 0.0.0.0:* LISTEN 3001/fam
tcp 0 0 0.0.0.0:32769 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:2049 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 2471/mysqld
tcp 0 0 0.0.0.0:139 0.0.0.0:* LISTEN 2493/smbd
tcp 0 0 0.0.0.0:683 0.0.0.0:* LISTEN 1350/ypserv
tcp 0 0 0.0.0.0:685 0.0.0.0:* LISTEN 2201/rpc.mountd
tcp 0 0 0.0.0.0:654 0.0.0.0:* LISTEN 2170/rpc.rquotad
tcp 0 0 127.0.0.1:783 0.0.0.0:* LISTEN 2384/spamd -d -c -a
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 1269/portmap
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 2656/httpd2
tcp 0 0 0.0.0.0:10000 0.0.0.0:* LISTEN 2475/perl
tcp 0 0 0.0.0.0:6000 0.0.0.0:* LISTEN 1940/X
tcp 0 0 0.0.0.0:785 0.0.0.0:* LISTEN 1878/rpc.ypxfrd
tcp 0 0 0.0.0.0:21 0.0.0.0:* LISTEN 3973/xinetd
tcp 0 0 192.168.1.100:53 0.0.0.0:* LISTEN 1961/named
tcp 0 0 127.0.0.1:53 0.0.0.0:* LISTEN 1961/named
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1985/sshd
tcp 0 0 0.0.0.0:23 0.0.0.0:* LISTEN 3973/xinetd
tcp 0 0 0.0.0.0:631 0.0.0.0:* LISTEN 2078/cupsd
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 2364/master
tcp 0 0 127.0.0.1:953 0.0.0.0:* LISTEN 1961/named
tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN 2656/httpd2
tcp 0 0 0.0.0.0:668 0.0.0.0:* LISTEN 1334/rpc.statd
tcp 0 0 0.0.0.0:7741 0.0.0.0:* LISTEN 2696/lisa

The problem was due to the fact that inetd was listening of port 21, which is precisely the port use by proftp.

Here is the content of my the proftpd.conf file:

[root@sun etc]# more /etc/proftpd.conf
# This is a basic ProFTPD configuration file (rename it to
# 'proftpd.conf' for actual use. It establishes a single server
# and a single anonymous login. It assumes that you have a user/group
# "nobody" and "ftp" for normal operation and anon.

ServerName "ProFTPD Default Installation"
ServerType inetd
DefaultServer on

# Allow FTP resuming.
# Remember to set to off if you have an incoming ftp for upload.
AllowStoreRestart on

# Port 21 is the standard FTP port.
Port 21

# Umask 022 is a good standard umask to prevent new dirs and files
# from being group and world writable.
Umask 022

# To prevent DoS attacks, set the maximum number of child processes
# to 30. If you need to allow more than 30 concurrent connections
# at once, simply increase this value. Note that this ONLY works
# in standalone mode, in inetd mode you should use an inetd server
# that allows you to limit maximum number of processes per service
# (such as xinetd).
MaxInstances 30

# Set the user and group under which the server will run.
User nobody
Group nogroup

# To cause every FTP user to be "jailed" (chrooted) into their home
# directory, uncomment this line.
#DefaultRoot ~

# Normally, we want files to be overwriteable.
<Directory />
AllowOverwrite on
</Directory>

# Needed for NIS.

PersistentPasswd off

# Default root can be used to put users in a chroot environment.
# As an example if you have a user foo and you want to put foo in /home/foo
# chroot environment you would do this:
#
# DefaultRoot /home/foo foo
Include /etc/proftpd-anonymous.conf

My problem came from Servertype which was Standalone and which should have been inetd (as I use inetd and do not run proftpd as daemon)

Finally, my proftpd-xinetd file looks like this:

[root@sun etc]# more /etc/xinetd.d/proftpd-xinetd
# default: off
# description: proftpd server, xinetd version. \
# Don't run the standalone version if you run \
# this!
service ftp
{
disable = no
socket_type = stream
wait = no
user = root
server = /usr/sbin/in.ftpd
log_on_success += DURATION USERID
log_on_failure += USERID
nice = 10
}

I have also deleted the FTP file from that directory.
Now you just have to adapt proftpd.conf file in order to grant / deny access to users.
I have spent evenings during 2 weeks trying to solve this. Hope this will also work fine for you with those indications.

Regards,
Vincent
 
Old 04-04-2004, 05:32 PM   #9
jimi_j
Member
 
Registered: Jan 2004
Distribution: CentOS
Posts: 30

Original Poster
Rep: Reputation: Disabled
cheers for the post Vincent, my /etc/proftpd.conf file has Servertype as standalone so i changed it to xinetd but this made no difference. what i dont have is a /etc/xinetd.d/proftpd-xinetd file - do i need to create one? & why wouldnt there already be one?

thanks heaps.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
xinetd & ftp servers dominant Linux - Software 0 01-11-2005 03:23 AM
Inetd & Xinetd Obie Linux - Security 3 09-30-2004 04:57 PM
xinetd, ftp, and other services jimi_j Linux - Software 0 03-09-2004 05:37 PM
Cannot connect via telnenet or ftp (Mandrake/Xinetd) justAnotherGuy Linux - Software 1 07-31-2003 12:41 AM
ftp/telnet & xinet.d/xinetd.conf adenardo Linux - General 3 12-20-2001 09:09 PM


All times are GMT -5. The time now is 09:43 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration