Sysop: | Amessyroom |
---|---|
Location: | Fayetteville, NC |
Users: | 43 |
Nodes: | 6 (0 / 6) |
Uptime: | 95:26:04 |
Calls: | 290 |
Files: | 904 |
Messages: | 76,417 |
● fetchmail.service - LSB: init-Script for system wide fetchmail daemon
It's dead, but still fetching mail!
I tried
root@titan ~ /etc/init.d/fetchmail --quit
Not starting fetchmail daemon, disabled via /etc/default/fetchmail.
I would like to stop fetchmail on Debian 11. I tried command systemctl stop fetchmail and system status fetchmail reported
● fetchmail.service - LSB: init-Script for system wide fetchmail daemon
Loaded: loaded (/etc/init.d/fetchmail; generated)
Active: inactive (dead) since Sat 2024-12-28 10:37:58 CET; 6h ago
Docs: man:systemd-sysv-generator(8)
Process: 1250 ExecStart=/etc/init.d/fetchmail start (code=exited, status=0/SUCCESS)
Process: 1199929 ExecStop=/etc/init.d/fetchmail stop (code=exited, status=0/SUCCESS)
Tasks: 1 (limit: 57750)
Memory: 1.9M
CPU: 6min 33.392s
CGroup: /system.slice/fetchmail.service
└─1264 /usr/bin/fetchmail -f /etc/fetchmarc
--pidfile /var/run/fetchmail/fetchmail.pid --syslog
...
Dec 28 17:06:54 titan fetchmail[1264]: reading message
mailbox@rogerprice.org@mail.gandi.net:1 of 1 (9321 octets) flushed
It's dead, but still fetching mail! I tried
root@titan ~ /etc/init.d/fetchmail --quit
Not starting fetchmail daemon, disabled via /etc/default/fetchmail.
but fetchmail goes on fetching mail. What is the correct way of stopping fetchmail?
Roger
but fetchmail goes on fetching mail. What is the correct way of
stopping fetchmail?
On Sat, 28 Dec 2024 17:21:08 +0100 (CET)
Roger Price <debian@rogerprice.org> wrote:
but fetchmail goes on fetching mail. What is the correct way of
stopping fetchmail?
Perhaps there is a fetchmail.timer unit that is starting up
fetchmail.service from time to time?
systemctl status fetchmail.timer
You might also look at /usr/share/doc/fetchmail/README.systemd
I tried 4 times. then I tried
/etc/init.d/fetchmail stop
but although dead for 6 hours, fetchmail continued to fetch mails.
So I tried
root@titan ~ ps -ef | grep fetch
fetchma+ 1264 1 0 Sep25 ? 00:06:33 /usr/bin/fetchmail -f
/etc/fetchmailrc --pidfile /var/run/fetchmail/fetchmail.pid --syslog
root@titan ~ kill 1264
On Sat, Dec 28, 2024 at 11:36:44 -0700, Charles Curley wrote:
On Sat, 28 Dec 2024 17:21:08 +0100 (CET)Perhaps there's a cron job that starts it.
Roger Price <debian@rogerprice.org> wrote:
but fetchmail goes on fetching mail. What is the correct way of
stopping fetchmail?
Perhaps there is a fetchmail.timer unit that is starting up
fetchmail.service from time to time?
systemctl status fetchmail.timer
You might also look at /usr/share/doc/fetchmail/README.systemd
root@titan ~ ps -ef | grep fetch
fetchma+ 1264 1 0 Sep25 ? 00:06:33 /usr/bin/fetchmail -f
/etc/fetchmailrc --pidfile /var/run/fetchmail/fetchmail.pid --syslog
root@titan ~ kill 1264
That process had been running for three months.(*) It wasn't "dead for 6 hours" at the moment you ran those commands.
● fetchmail.service - LSB: init-Script for system wide fetchmail daemon
Loaded: loaded (/etc/init.d/fetchmail; generated)
Active: inactive (dead) since Sat 2024-12-28 10:37:58 CET; 6h ago
Docs: man:systemd-sysv-generator(8)
Process: 1250 ExecStart=/etc/init.d/fetchmail start (code=exited, status=0/SUCCESS)
Process: 1199929 ExecStop=/etc/init.d/fetchmail stop (code=exited, status=0/SUCCESS)
Tasks: 1 (limit: 57750)
Memory: 1.9M
CPU: 6min 33.392s
CGroup: /system.slice/fetchmail.service
└─1264 /usr/bin/fetchmail -f /etc/fetchmarc
--pidfile /var/run/fetchmail/fetchmail.pid --syslog
...
Dec 28 17:06:54 titan fetchmail[1264]: reading message
mailbox@rogerprice.org@mail.gandi.net:1 of 1 (9321 octets) flushed
It's dead
Roger Price (12024-12-28):
● fetchmail.service - LSB: init-Script for system wide fetchmail daemon
Loaded: loaded (/etc/init.d/fetchmail; generated)
Active: inactive (dead) since Sat 2024-12-28 10:37:58 CET; 6h ago
Docs: man:systemd-sysv-generator(8)
Process: 1250 ExecStart=/etc/init.d/fetchmail start (code=exited, status=0/SUCCESS)
Process: 1199929 ExecStop=/etc/init.d/fetchmail stop (code=exited, status=0/SUCCESS)
Tasks: 1 (limit: 57750)
Memory: 1.9M
CPU: 6min 33.392s
CGroup: /system.slice/fetchmail.service
└─1264 /usr/bin/fetchmail -f /etc/fetchmarc
--pidfile /var/run/fetchmail/fetchmail.pid --syslog
...
Dec 28 17:06:54 titan fetchmail[1264]: reading message
mailbox@rogerprice.org@mail.gandi.net:1 of 1 (9321 octets) flushed
It's dead
It is “dead” but not dead, since it still has a process. Your problem is there, you do not need to look elsewhere: systemctl stop did not do its
job properly. You need to find out why.
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, [...]
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
journalctl -u fetchmail.service
I looked at the file list for the oldstable package (the one I believe
Roger is using) at <https://packages.debian.org/bullseye/amd64/fetchmail/filelist> and
this one does NOT have a systemd unit file. As I've pointed out a
couple times now, that version of the package only has an init.d file.
So, there is no service type, there is no KillMode, and I'm not *aware*
of any kind of timeouts enforced by the init.d script.
/usr/lib31a36
/usr/lib/systemd
/usr/lib/systemd/user
/usr/lib/systemd/user/fetchmail.service
/usr/share/doc/fetchmail/README.systemd
And the fetchma+ process disappeared - I hope it no longer
rises from the dead.
On Saturday, December 28, 2024 6:56:09 PM CET, Roger Price wrote:
And the fetchma+ process disappeared - I hope it no longer rises from the
dead.
then make sure you run
systemctl disable fetchmail.service
otherwise it will start again at next boot.
then make sure you run
systemctl disable fetchmail.service
otherwise it will start again at next boot.
ExecStart=/usr/bin/fetchmail --pidfile /run/fetchmail/fetchmailrc.pid -f /etc/fetchmailrc
https://gitlab.archlinux.org/archlinux/packaging/packages/fetchmail
Sent: Saturday, December 28, 2024 at 10:18 PM
From: "John Hasler" <john@sugarbit.com>
To: debian-user@lists.debian.org
Subject: Re: Correct way to stop fetchmail
On Unstable:
toncho/~ 20 systemctl cat fetchmail.service
# /run/systemd/generator.late/fetchmail.service
# Automatically generated by systemd-sysv-generator
[Unit]
Documentation=man:systemd-sysv-generator(8)
SourcePath=/etc/init.d/fetchmail
Description=LSB: init-Script for system wide fetchmail daemon Before=multi-user.target
Before=multi-user.target
Before=multi-user.target
Before=graphical.target
After=network-online.target
After=remote-fs.target
After=mail-transport-agent.target
After=postfix.service
After=exim4.service
After=nss-lookup.target
Wants=network-online.target
[Service]
Type=forking
Restart=no
TimeoutSec=5min
IgnoreSIGPIPE=no
KillMode=process
GuessMainPID=no
RemainAfterExit=yes
SuccessExitStatus=5 6
ExecStart=/etc/init.d/fetchmail start
ExecStop=/etc/init.d/fetchmail stop
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.
Hello,
On Sun, Dec 29, 2024 at 02:16:42PM +0100, pocket@homemail.com wrote:
https://gitlab.archlinux.org/archlinux/packaging/packages/fetchmail
What is your point? There is a native systemd service unit for fetchmail
in the next release of Debian. Your constant off-topic proselytizing of
Arch here is unwelcome.
On Sun, Dec 29, 2024 at 13:50:56 +0000, Andy Smith wrote:
On Sun, Dec 29, 2024 at 02:16:42PM +0100, pocket@homemail.com wrote:
https://gitlab.archlinux.org/archlinux/packaging/packages/fetchmail
What is your point? There is a native systemd service unit for fetchmail
in the next release of Debian. Your constant off-topic proselytizing of Arch here is unwelcome.
That's not how I perceived it. If Arch has a systemd unit file that
seems a lot more usable than the one we saw in Debian's packaging,
John posted content of the service file *generated* for SysV init script.