On 28/12/2024 23:47, Greg Wooledge wrote:
On Sat, Dec 28, 2024 at 17:21:08 +0100, Roger Price wrote:
  root@titan ~ /etc/init.d/fetchmail --quit
  Not starting fetchmail daemon, disabled via /etc/default/fetchmail.

The correct way to use a legacy sysv-rc init.d script to stop a service
is:

     /etc/init.d/fetchmail stop

I do not have fetchmail installed, so I am unaware of its idiosyncrasy. At certain step, most of init.d scripts were modified to use systemctl commands when systemd is running, so usually it should not matter if a systemd unit generated from its SysV init script is started or stopped using "service", "systemctl", or direct script invocation.

When properly configured, systemd unit should properly stop if the daemon exits with 0 exit code e.g. in response to some direct command.

My guess is that the main service process exited, but some its child (it belongs to service's cgroup) were continuing running for some reason. Unless improperly configured, systemd is able to kill all processes after some timeout. Perhaps something is wrong with service type, KillMode, or timeouts.

Commands that might help to discover what actually happened

    systemctl cat fetchmail.service
    journalctl -u fetchmail.service


Reply via email to