Re: Fetchmail seems to silently fail when I use the --pidfile option

Matthias Andree <[email protected]>
Newsgroups gmane.mail.fetchmail.user
Message-ID <[email protected]>
Am 12.10.20 um 23:04 schrieb Alex Hall:
> Hello,
> I've used fetchmail for a couple years, as a way of pulling emails
> into the Request Tracker ticket system I set up for my work. I'm
> trying to better automate it, by setting it up with Monit. To do that,
> I want to use the --pidfile option when starting or quitting
> fetchmail, which I've not tried before.
>
> First, the details. I'm on Debian 8, with fetchmail 6.3.26. I
> installed this from Debian's package manager; I didn't compile any
> source. I know Debian 8 is outdated, but we're stuck on this server
> for a while for various reasons. The server reports that this is the
> most recent version of fetchmail it can find.
>
> In the past, I'd start fetchmail manually (this is part of what I want
> to automate with Monit). I use this command:
> sudo -u rt-user fetchmail -f /path/rt4/fetchmailrc
>
> To let Monit have a known pid file to monitor, I tried this command:
> sudo -u rt-user fetchmail -f /path/rt4/fetchmailrc --pidfile
> /var/run/rt_fetchmail.pid
>
> When I run that command in the terminal, nothing at all happens. I get
> no output, /var/run/rt_fetchmail.pid is not created, and fetchmail
> doesn't seem to run. I should say here that the fetchmailrc file being
> used commands fetchmail to start as a daemon. If I leave off the
> --pidfile bit, the daemon starts as expected. I can then
> sudo -u rt-user fetchmail --quit
> to kill it. Running that quit command after using the --pidfile
> variant produces no output.
>
Assuming it's a stopgap before the server is going to be replaced:

You can try and run fetchmail with the additional options     --nosyslog
--logfile /dev/stderr
and see if that gives you output, or possibly add -d0 to override any
"set daemon" directives in your fetchmailrc file.

> It seems like the --pidfile option causes a silent failure, but I
> can't figure out what's going on. The log only shows normal mail
> managing stuff, with no errors that I've found, and the terminal has
> no output whatsoever.

This is strange, check if the user you "sudo" into has a proper shell
and permissions and the session doesn't crash before starting fetchmail.
Possibly you may also want to install strace and try

sudo -u rt-user strace -f fetchmail -f /path/rt4/fetchmailrc --pidfile
/var/run/rt_fetchmail.pid

and see where it all ends up. (strace -o /path/to/dumpfile <- that saves
the output).



_______________________________________________
Fetchmail-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fetchmail-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.