Bug#1010302: Not testing $OPTIONS in the /lib/systemd/system/proftpd.service
Viktor Simon
simon at fastvps.ru
Thu Apr 28 12:06:42 BST 2022
Package: proftpd-core
Version: 1.3.7a+dfsg-12+deb11u2
Severity: normal
We have next content in the unit file:
root at changeme:/# cat /lib/systemd/system/proftpd.service
[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=OPTIONS= CONFIG_FILE=/etc/proftpd/proftpd.conf
EnvironmentFile=-/etc/default/proftpd
ExecStartPre=/usr/sbin/proftpd --configtest -c $CONFIG_FILE
ExecStart=/usr/sbin/proftpd -c $CONFIG_FILE $OPTIONS
ExecReload=/bin/kill -HUP $MAINPID
PIDFile=/run/proftpd.pid
[Install]
WantedBy=multi-user.target
root at changeme:/#
We can see test string:
ExecStartPre=/usr/sbin/proftpd --configtest -c $CONFIG_FILE
And we can see start string:
ExecStart=/usr/sbin/proftpd -c $CONFIG_FILE $OPTIONS
In the start string, it uses $CONFIG_FILE and $OPTIONS, but in the test
string, it does not use $OPTIONS.
So, options in the /etc/default/proftpd do not work, when proftpd testing
config before start.
When the server haven't correct hostname or it is unable to resolve the
hostname, proftpd can't start.
For solve this, we can add in the /etc/default/proftpd:
OPTIONS="-S 0.0.0.0"
Now, proftpd can be start successfully and not require of hostname
resolving, but proftpd still can't start, because $OPTIONS is not using in
ExecStartPre.
If i open /lib/systemd/system/proftpd.service and find string:
ExecStartPre=/usr/sbin/proftpd --configtest -c $CONFIG_FILE
And change this to:
ExecStartPre=/usr/sbin/proftpd --configtest -c $CONFIG_FILE $OPTIONS
And save changes via "systemctl daemon-reload"
All's good, proftpd correctly work.
Well, i think that it correct, if $OPTIONS testing in ExecStartPre and this
should be added by default.
P.S. Unfortunately, this can't be overridden via
/etc/systemd/system/proftpd.service.d/override.conf
--
Best regards, Victor Simon
FastVPS LLC
More information about the Pkg-proftpd-maintainers
mailing list