FS#32546 - [inetutils] systemd service unit for ftpd is missing PIDFile
Attached to Project:
Arch Linux
Opened by Jan (DosAmp) - Thursday, 08 November 2012, 15:04 GMT
Last edited by Eric Belanger (Snowman) - Saturday, 14 December 2013, 23:02 GMT
Opened by Jan (DosAmp) - Thursday, 08 November 2012, 15:04 GMT
Last edited by Eric Belanger (Snowman) - Saturday, 14 December 2013, 23:02 GMT
|
Details
Description:
Service unit file doesn't reference ftpd's pidfile /var/run/ftpd.pid, service doesn't start because of this. Package version: 1.9.1-4 Steps to reproduce: 0. (stop any other FTP daemon) 1. systemctl start ftpd.service -> journal says "Started FTPD Daemon", daemon is not running 2. add "PIDFile=/var/run/ftpd.pid" to [Service] section of /usr/lib/systemd/system/ftpd.service 3. systemctl --system daemon-reload 4. repeat step 1 -> daemon is running Further thoughts: * pidfile remains after service is stopped, triggering "PID ... read from file /var/run/ftpd.pid does not exist.". * Adding "ExecStopPost=/bin/rm -f /var/run/ftpd.pid" leads to "PID file /var/run/ftpd.pid not readable (yet?) after start." instead. |
This task depends upon
$ systemctl start ftpd.service
$ systemctl status ftpd.service
ftpd.service - FTPD Daemon
Loaded: loaded (/usr/lib/systemd/system/ftpd.service; disabled)
Active: active (running) since Thu, 2012-11-08 18:50:05 EST; 7s ago
Process: 23720 ExecStart=/usr/sbin/ftpd -D (code=exited, status=0/SUCCESS)
Main PID: 23722 (ftpd)
CGroup: name=systemd:/system/ftpd.service
└ 23722 /usr/sbin/ftpd -D
Nov 08 18:50:05 ovide systemd[1]: Starting FTPD Daemon...
Nov 08 18:50:05 ovide systemd[1]: Started FTPD Daemon.
# systemctl start ftpd.service
# pidof ftpd; echo $?
1
# systemctl status ftpd.service
ftpd.service - FTPD Daemon
Loaded: loaded (/usr/lib/systemd/system/ftpd.service; enabled)
Active: inactive (dead) since Fri, 2012-11-09 01:41:09 CET; 7s ago
Process: 2697 ExecStart=/usr/sbin/ftpd -D (code=exited, status=0/SUCCESS)
Main PID: 2698 (code=exited, status=0/SUCCESS)
CGroup: name=systemd:/system/ftpd.service
Nov 09 01:41:09 sonic systemd[1]: Starting FTPD Daemon...
Nov 09 01:41:09 sonic systemd[1]: Started FTPD Daemon.
$ systemctl status ftpd.service | grep -E '^\s+(Process|Main PID):'
ftpd.service - FTPD Daemon
Process: 3303 ExecStart=/usr/sbin/ftpd -D (code=exited, status=0/SUCCESS)
Main PID: 3304 (code=exited, status=0/SUCCESS)
$ journalctl -u ftpd.service
-- Logs begin at Wed, 2012-11-07 13:00:29 CET, end at Wed, 2012-11-07 13:44:39 CET. --
$ journalctl _PID=3303
-- Logs begin at Wed, 2012-11-07 13:00:29 CET, end at Wed, 2012-11-07 13:44:39 CET. --
$ journalctl _PID=3304
-- Logs begin at Wed, 2012-11-07 13:00:29 CET, end at Wed, 2012-11-07 13:44:39 CET. --
Something is really borked here, reference system doesn't show this symptoms either.
# systemctl stop ftpd
# /usr/sbin/ftpd -D
$ pidof ftpd
1128
$ cat /var/run/ftpd.pid
1128
The service unit works fine on my host, but neither on this box (thinclient with 512 MB CF card as root filesystem and external /var and /home) nor the VM I set up prior to test this space-limited environment. Following packages are missing from the base group:
$ pacman -Sg base | awk '{print $2}' > base.txt
$ pacman -Q | awk '{print $1}' > installed.txt
$ comm -23 base.txt installed.txt
cryptsetup
gettext
jfsutils
less
licenses
man-db
man-pages
mdadm
pcmciautils
ppp
reiserfsprogs
texinfo
usbutils
xfsprogs
The exact same symptom occurs with other daemons like bftpd which has GuessMainPID explicitly set (but upon closer inspection doesn't create or write to a pidfile at all, probably due to root privilege dropping, unlike ftpd).
Apr 04 20:22:45 sonic systemd[1]: PID file /var/run/ftpd.pid not readable (yet?) after start.
Apr 04 20:22:45 sonic systemd[1]: Started FTPD Daemon.
Maybe this keeps systemd from guessing the correct pid file on its own?
Systemd is not able of loading 'ftpd -D' properly. Issuing 'ftpd -D' on the command line works though.
I needed to reboot the server for the /bin > /usr/bin move (just to make sure everything was ok) and was surprised to see the ftpd daemon running. I stoped / started the service
which failed again. Rebooted and it works. I have no idea what is going on but hope this additional info helps