aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/systemd
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/systemd')
-rw-r--r--contrib/systemd/README.systemd23
-rw-r--r--contrib/systemd/fetchmail.service11
2 files changed, 34 insertions, 0 deletions
diff --git a/contrib/systemd/README.systemd b/contrib/systemd/README.systemd
new file mode 100644
index 00000000..fd7229a0
--- /dev/null
+++ b/contrib/systemd/README.systemd
@@ -0,0 +1,23 @@
+To run fetchmail as a systemd user service, for an individual user:
+
+(1) Configuration
+
+Set up your .fetchmailrc so that "fetchmail --nodetach" actually
+fetches your mail correctly.
+
+(2) Tell systemd to run it as a service
+
+Allow daemons to keep running after you log out (optional):
+$ sudo loginctl enable-linger $USERNAME
+
+Make the service available:
+$ systemctl --user enable fetchmail.service
+
+Actually turn it on:
+$ systemctl --user start fetchmail.service
+
+Monitor it, to check if it's okay:
+$ systemctl --user status fetchmail.service
+
+Monitor it harder:
+$ journalctl --user -xeu fetchmail.service
diff --git a/contrib/systemd/fetchmail.service b/contrib/systemd/fetchmail.service
new file mode 100644
index 00000000..7e075017
--- /dev/null
+++ b/contrib/systemd/fetchmail.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Fetchmail Daemon
+Documentation=man:fetchmail(1)
+
+[Service]
+ExecStart=fetchmail --nodetach --daemon 300
+ExecStop=fetchmail --quit
+Restart=always
+
+[Install]
+WantedBy=default.target