Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
20 years ago

A new problem when uses the ftp service by inetd

<<<<My English is not good, please forgives.>>>>

When a ftp user will connect the server, inetd then

starts a ftpd process, but when the ftp user will disconnect,

the ftpd process did not end.

=============================================================# ps

PID PORT STAT SIZE SHARED %CPU COMMAND

......

23 S 139K 0K 0.0 /bin/dhcpcd -NRY

24 S 95K 0K 0.0 /bin/inetd

25 S 279K 0K 0.0 /bin/boa -c /mnt/cf/httpd/

26 S 195K 0K 0.0 /bin/sh

30 S 287K 0K 0.0 /bin/ftpd

34 S 287K 0K 0.0 /bin/ftpd

41 S 287K 0K 0.0 /bin/ftpd

47 R 83K 0K 0.0 ps

==============================================================

now there is 3 ftpd process, but in fact was i has connected thrice , not three users connects.

why??

<<<<My English is not good, please forgives.>>>>

thx.

2 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    You&#39;re right, at the end of the main function, the ftp server goes into an infinite loop looking for commands to parse but it doesn&#39;t check for a closed socket.

    As quirky as it sounds, you need to send a "quit" command at the end of your session in order for the ftp server to shut down.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    thx for your reply,

    But i cannot guarantee each people all send "quit" at the end of the session.

    After I modify the code ( i add a "exit(0);" in the ftpcmd.c after send "bye" to client),

    using the FlashFXP software not to have the question,

    but using the IE not to be good.

    I cant qualify the user to use a software to link the ftp service.