Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am trying to start services vsftpd and sshd using xinetd. my config files are as follows.

  1. /etc/xinetd.conf

    defaults
    {
    instances               = 60
    log_type                = FILE /var/log/xinetdlog
    log_on_success          = HOST PID
    log_on_failure          = HOST
    cps                     = 25 30
    only_from       = localhost
    }
    includedir /etc/xinetd.d
    
  2. /etc/xinetd.d/ftp

    service ftp
    {
    disable = no
    server = /usr/sbin/vsftpd
    server_args = -l
    user = root
    socket_type = stream
    protocol = tcp
    wait = no
    instances = 4
    flags = REUSE
    nice = 10
    log_on_success      += DURATION HOST USERID
    only_from = 127.0.0.1 10.0.0.0/24
    }
    
  3. /etc/xinetd.d/ssh

    service ssh
    {
    disable = no
    log_on_failure += USERID
    server = /usr/sbin/sshd
    user = root
    socket_type = stream
    protocol = tcp
    wait = no
    instances = 20
    flags = REUSE
    only_from = 127.0.0.1 10.0.0.0/24
    }
    

Even though i've included only_from attribute, vsftp server as well as ssh server are refusing connection from localhost. while vsftp and ssh servers are working fine individually when i check with "service vsftpd start" and "service ssh start". when i did debug using "xinetd -d" throug terminal i got the output as

13/10/20@00:06:08: DEBUG: 3592 {cnf_start_services} Started service: ftp
13/10/20@00:06:08: DEBUG: 3592 {cnf_start_services} Started service: ssh
13/10/20@00:06:08: DEBUG: 3592 {cnf_start_services} mask_max = 8, services_started = 2
13/10/20@00:06:08: NOTICE: 3592 {main} xinetd Version 2.3.14 started with libwrap loadavg options compiled in.
13/10/20@00:06:08: NOTICE: 3592 {main} Started working: 2 available services
13/10/20@00:06:08: DEBUG: 3592 {main_loop} active_services = 2
13/10/20@00:06:16: DEBUG: 3592 {main_loop} select returned 1
13/10/20@00:06:16: DEBUG: 3592 {server_start} Starting service ftp
13/10/20@00:06:16: DEBUG: 3592 {main_loop} active_services = 2
13/10/20@00:06:16: DEBUG: 3607 {exec_server} duping 9
13/10/20@00:06:16: DEBUG: 3592 {main_loop} active_services = 2
13/10/20@00:06:16: DEBUG: 3592 {main_loop} select returned 1
13/10/20@00:06:16: DEBUG: 3592 {check_pipe} Got signal 17 (Child exited)
13/10/20@00:06:16: DEBUG: 3592 {child_exit} waitpid returned = 3607
13/10/20@00:06:16: DEBUG: 3592 {server_end} ftp server 3607 exited
13/10/20@00:06:16: DEBUG: 3592 {svc_postmortem} Checking log size of ftp service
13/10/20@00:06:16: INFO: 3592 {conn_free} freeing connection
13/10/20@00:06:16: DEBUG: 3592 {child_exit} waitpid returned = -1

both services are getting started but neither of them is working.

after banging for 3-4 hours i still don't have any clue about this error. Any help would be appreciated. thanks!

share|improve this question
    
I have suggested that this question belongs on Stack Overflow. –  Xavierjazz Oct 19 '13 at 19:23
1  
yes! i posted the same question few minutes back on stackoverflow. but i was suggested to post on this site. superuser.com thanks! –  Faizan Shaik Oct 19 '13 at 19:27
    
This definitely belongs to either SuperUser or ServerFault. Anyway, does vsftpd log anything? –  Cristian Ciupitu Oct 19 '13 at 20:00
    
where can i find the vsftpd log if it is run by xinetd. when i checked /var/log/vsftpd.log it had only logs when it had run by vsftpd daemon and not by xinetd daemon. –  Faizan Shaik Oct 20 '13 at 1:17

1 Answer 1

The signal(7) man page says:

Signal     Value     Action   Comment
---------------------------------------------------------
SIGCHLD   20,17,18    Ign     Child stopped or terminated

This means that whenever a child process stops i.e. vsftpd or sshd, the parent - xinetd - receives signal 17 (which would be ignored by default, but in your case it's not).

You also need to start sshd with -i:

-i

Specifies that sshd is being run from inetd(8). sshd is normally not run from inetd because it needs to generate the server key before it can respond to the client, and this may take tens of seconds. Clients would have to wait too long if the key was regenerated every time. However, with small key sizes (e.g. 512) using sshd from inetd may be feasible.

I don't know what vsftpd version you're using, but vsftpd-2.2.2-6.el6_0.1 works fine if I set listen=NO in /etc/vsftpd/vsftpd.conf and run it without any arguments.

share|improve this answer
    
I have added sshd arguments as server_args = -i to /etc/xinetd.d/ssh file. but still, it is not working. –  Faizan Shaik Oct 20 '13 at 1:15
    
@FaizanShaik, it works fine for me with xinetd-2.3.14-39.el6_4.i686 and openssh-server-5.3p1-84.1.el6.i686. –  Cristian Ciupitu Oct 20 '13 at 14:44

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.