ProFTPD not logging

Hi @Ilia,

First of all, thank you very much for this patch. I haven’t tried it yet but looking at my friend’s server, I actually solved the issue in a bit different way. What surprised me was that ProFTPd didn’t want to log to /var/log/proftpd/proftpd.log on Alma when I put the path there in the logging options in Webmin. So, I had a look at the startup script which was:

[Unit]
Description = ProFTPD FTP Server
Wants=network-online.target
After=network-online.target nss-lookup.target local-fs.target remote-fs.target

[Service]
Type = simple
Environment = PROFTPD_OPTIONS=
EnvironmentFile = -/etc/sysconfig/proftpd
ExecStartPre = /usr/sbin/proftpd --configtest
ExecStart = /usr/sbin/proftpd --nodaemon $PROFTPD_OPTIONS
ExecReload = /bin/kill -HUP $MAINPID
PIDFile = /run/proftpd/proftpd.pid

[Install]
WantedBy = multi-user.target

So I changed it to:

[Unit]
Description=ProFTPD FTP Server
Wants=network-online.target
After=network-online.target nss-lookup.target local-fs.target remote-fs.target

[Service]
Type=forking
Environment=PROFTPD_OPTIONS= CONFIG_FILE=/etc/proftpd.conf
EnvironmentFile=-/etc/sysconfig/proftpd
ExecStartPre=/usr/sbin/proftpd --configtest -c $CONFIG_FILE
ExecStart=/usr/sbin/proftpd -c $CONFIG_FILE $PROFTPD_OPTIONS
ExecReload=/bin/kill -HUP $MAINPID
PIDFile=/run/proftpd/proftpd.pid

[Install]
WantedBy=multi-user.target

Afterwards, I commented out these lines in my ProFTPd configuration file:

LogFormat			default	"%h %l %u %t \"%r\" %s %b"
LogFormat			auth	"%v [%P] %h %t \"%r\" %s"

And

LogOptions			-Timestamp -Hostname +RoleBasedProcessLabels

After rebooting, it’s now working with the original Fail2Ban rule, and ProFTPd is logging to the path that I set to /var/log/proftpd/proftpd.log