On Sun, Dec 29, 2024 at 09:50:31 +0100, Roger Price wrote: > On Debian 12 the command systemctl status fetchmail now has a "CGroup" entry: > > ● fetchmail.service - LSB: init-Script for system wide fetchmail daemon > Loaded: loaded (/etc/init.d/fetchmail; generated) > Active: active (running) since Sat 2024-12-28 10:46:38 CET; 22h ago > Docs: man:systemd-sysv-generator(8) > Process: 252241 ExecStart=/etc/init.d/fetchmail start (code=exited, > status=0/SUCCESS) > Tasks: 1 (limit: 38046) > Memory: 3.0M > CPU: 52.194s > CGroup: /system.slice/fetchmail.service > └─252255 /usr/bin/fetchmail -f /etc/fetchmail > --pidfile /var/run/fetchmail/fetchmail.pid --syslog > > So I'm assuming that something in Debian 11 fetchmail was mismanaging the > PIDs, and that that problem has been solved, although Debian 12 file > /var/run/fetchmail/fetchmail.pid shows > > 252255 > 150 > > which contains a PID which does not agree with the Process: declaration in > the systemctl output.
I'm assuming 252241 was the PID of the /etc/init.d/fetchmail shell script, whereas 252255 is the PID of the /usr/bin/fetchmail daemon launched by the init.d script. Note that the "Process:" line also has "code=exited, status=0/SUCCESS". That's all perfectly normal for an init.d script that launches either a background shell process, or a daemon which forks its own child and then terminates its original process to detach itself from the shell. All of that forking and detaching nonsense and untracked child processes are why people developed modern service managers (daemontools, runit, systemd and so on).