From: Joe Acquisto-j. <jo...@j4...> - 2022-01-23 18:36:12
|
> On Thu, Jan 20, 2022 at 11:34:26AM +0200, Peter Pentchev wrote: > [snip] >> directory if necessary). Something like this works for me (note that >> I do not have a logfile directive in my fetchmail config file, so >> it will send its output to the standard output stream by default): >> >> [roam@straylight ~]$ cat ~/.config/systemd/user/fetchmail.service >> [Unit] >> Description=Run fetchmail in daemon mode. >> Documentation=man:fetchmail(1) >> After=network-online.target >> Wants=network-online.target >> >> [Service] >> Type=simple >> ExecStartPre=-fetchmail -ve200 >> ExecStart=fetchmail -ve25 -Nd120 >> ExecStop=fetchmail --quit >> KillMode=process > > ...and of course, I forgot two lines that are kind of important: > > [Install] > WantedBy=default.target > > G'luck, > Peter > > -- Thanks to all. This is how I achieved success (getting Fetchmail to start and stop in systemd world that is): ------------------------------------- [Unit] Description=remote-mail retrieval utility runin daaemon mode After=network.target Wants=network.target [Service] Type=simple EnvironmentFile=/root/.fetchmailrc #User=fetchmail #ExecStart=/usr/lib/fetchmail-systemd-exec ExecStart=/usr/local/bin/fetchmail -v #-Nd120 ExecStop=/usr/local/bin/fetchmail -q KillMode=process #RestartSec=1 [Install] WantedBy=multi-user.target --------------------------------------------- Thanks again to all. joe a |