get on a non existing file cause server error and eventually hang
ArthurDents opened this issue · comments
Hi
When requesting a file (e.g. get somefile.txt) that does not exist the uFTP server stops working correctly and eventually there is a permanent hang when applying more ftp commands. Tested on an arm platform.
E.g:
uFTP
Hello uFTP server v2.2.0 RC1 starting..
Reading configuration from
-> /etc/uftpd.cfg
Reset of worker id: 0
Reset of worker id: 1
Reset of worker id: 2
Reset of worker id: 3
Reset of worker id: 4
Reset of worker id: 5
Reset of worker id: 6
Reset of worker id: 7
Reset of worker id: 8
Reset of worker id: 9
Reset of worker id: 10
Reset of worker id: 11
Reset of worker id: 12
Reset of worker id: 13
Reset of worker id: 14
Reset of worker id: 15
Reset of worker id: 16
Reset of worker id: 17
Reset of worker id: 18
Reset of worker id: 19
Reset of worker id: 20
Reset of worker id: 21
Reset of worker id: 22
Reset of worker id: 23
Reset of worker id: 24
Reset of worker id: 25
Reset of worker id: 26
Reset of worker id: 27
Reset of worker id: 28
Reset of worker id: 29
uFTP server starting..
data->clients[socketId].login.ownerShip.ownerShipSet = 1
data->clients[socketId].login.ownerShip.gid = 1000
data->clients[socketId].login.ownerShip.uid = 1000
createActiveSocket created socket = 6
Worker 0 is waiting for commands!
Reset of worker id: 0
PORT JOIN RETURN STATUS 0
createActiveSocket created socket = 0
Worker 0 is waiting for commands!
COMMAND NOT SUPPORTED ********* RETR somefile.txt
Reset of worker id: 0
inet_pton error occured
Closing the client 4
Reset of worker id: 0
data->clients[socketId].login.ownerShip.ownerShipSet = 1
data->clients[socketId].login.ownerShip.gid = 1000
data->clients[socketId].login.ownerShip.uid = 1000
PORT JOIN RETURN STATUS 0
createActiveSocket created socket = 5
Worker 0 is waiting for commands!
Reset of worker id: 0
data->clients[socketId].login.ownerShip.ownerShipSet = 1
data->clients[socketId].login.ownerShip.gid = 1000
data->clients[socketId].login.ownerShip.uid = 1000
createActiveSocket created socket = 5
Worker 0 is waiting for commands!
Reset of worker id: 0
1 Error: : Bad file descriptor
1 Errno = 9
2 Errno = 11
2 Errno = 11
2 Errno = 11
.. This goes on forever
BR
AD
Just tried uFTP...
Made a systemd service for it...
Wasted time....
After 2h-3h my Server stopped responding, because system/daemon log filled the whole disk up with "Errno = 11" spamming...
60GB of logs... just wth.. xD
Please fix this! xD
Anyway, if anyone needs an systemd service script, here you go:
Note: DAEMON_MODE = false
[Unit]
Description=uFTP Service
After=network.target
Conflicts=vsftpd.service proftpd.service
[Service]
Type=simple
ExecStart=/usr/bin/uFTP
PIDFile=/var/run/uFTP.pid
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s TERM $MAINPID
Restart=on-failure
RestartSec=5s
[Install]
WantedBy=multi-user.target
And maybe a better one (without logging???):
Note: DAEMON_MODE = true
[Unit]
Description=uFTPd Service
After=network.target
Conflicts=vsftpd.service proftpd.service
[Service]
Type=forking
PIDFile=/run/uFTPd.pid
ExecStart=/usr/bin/uFTP
ExecStop=/bin/kill -s TERM $MAINPID
ExecStartPost=/bin/sh -c 'umask 022; pgrep uFTP > /run/uFTPd.pid'
[Install]
WantedBy=multi-user.target
But i doubt that this error gets fixed in any future, so bye uFTP & hello any other lightweight ftpd xD
EDIT:
Back to uFTP, there is no other lightwight ftpd with virtual users xD
Well, need to check if this "error 11" appears again and probably move this looging to /dev/null via systemd xD
Cheers :-)
This kind of error should be solved since long time