home · contact · privacy
Fix systemd timers.
authorChristian Heller <c.heller@plomlompom.de>
Thu, 21 May 2020 22:24:52 +0000 (00:24 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Thu, 21 May 2020 22:24:52 +0000 (00:24 +0200)
buster/etc_files/mail/etc/systemd/system/fetchmail.service [deleted file]
buster/etc_files/mail/etc/systemd/system/fetchmail_old_account.service [new file with mode: 0644]
buster/etc_files/mail/etc/systemd/system/fetchmail_old_account.timer [new file with mode: 0644]
buster/etc_files/mail/etc/systemd/system/pingmail.timer [new file with mode: 0644]
buster/etc_files/mail/etc/systemd/system/timers.target.wants/fetchmail.timer [deleted file]
buster/etc_files/mail/etc/systemd/system/timers.target.wants/pingmail.timer [deleted file]
buster/setup_scripts/setup_mail.sh

diff --git a/buster/etc_files/mail/etc/systemd/system/fetchmail.service b/buster/etc_files/mail/etc/systemd/system/fetchmail.service
deleted file mode 100644 (file)
index dc8acb4..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-[Unit]
-Description=Run plom's fetchmail
-
-[Service]
-Type=oneshot
-User=plom
-# fetchmail returns 1 when no new mail, we want to catch that
-ExecStart=/bin/sh -c 'fetchmail || [ $? -eq 1 ]'
diff --git a/buster/etc_files/mail/etc/systemd/system/fetchmail_old_account.service b/buster/etc_files/mail/etc/systemd/system/fetchmail_old_account.service
new file mode 100644 (file)
index 0000000..dc8acb4
--- /dev/null
@@ -0,0 +1,8 @@
+[Unit]
+Description=Run plom's fetchmail
+
+[Service]
+Type=oneshot
+User=plom
+# fetchmail returns 1 when no new mail, we want to catch that
+ExecStart=/bin/sh -c 'fetchmail || [ $? -eq 1 ]'
diff --git a/buster/etc_files/mail/etc/systemd/system/fetchmail_old_account.timer b/buster/etc_files/mail/etc/systemd/system/fetchmail_old_account.timer
new file mode 100644 (file)
index 0000000..0568eeb
--- /dev/null
@@ -0,0 +1,8 @@
+[Unit]
+Description=Run fetchmail once every minute
+
+[Timer]
+OnCalendar=minutely
+
+[Install]
+WantedBy=timers.target
diff --git a/buster/etc_files/mail/etc/systemd/system/pingmail.timer b/buster/etc_files/mail/etc/systemd/system/pingmail.timer
new file mode 100644 (file)
index 0000000..dba0c9f
--- /dev/null
@@ -0,0 +1,8 @@
+[Unit]
+Description=Run pingmail check once every hour
+
+[Timer]
+OnCalendar=*-*-* *:00:00
+
+[Install]
+WantedBy=timers.target
diff --git a/buster/etc_files/mail/etc/systemd/system/timers.target.wants/fetchmail.timer b/buster/etc_files/mail/etc/systemd/system/timers.target.wants/fetchmail.timer
deleted file mode 100644 (file)
index c67e8e7..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-[Unit]
-Description=Run fetchmail once every minute
-
-[Timer]
-OnCalendar=*-*-* *:*:00
-
-[Install]
-WantedBy=timers.target
diff --git a/buster/etc_files/mail/etc/systemd/system/timers.target.wants/pingmail.timer b/buster/etc_files/mail/etc/systemd/system/timers.target.wants/pingmail.timer
deleted file mode 100644 (file)
index dba0c9f..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-[Unit]
-Description=Run pingmail check once every hour
-
-[Timer]
-OnCalendar=*-*-* *:00:00
-
-[Install]
-WantedBy=timers.target
index 09ae762dda88f387f03080d7e2114f039b4244fa..81200178b3460dd3beaabcf1eb0667bb971d08be 100755 (executable)
@@ -46,6 +46,8 @@ cp "${config_tree_prefix}/other_files/pingmailrc" /home/plom/.pingmailrc
 chown plom:plom /home/plom/.pingmailrc
 su -lc "cd && git clone https://plomlompom.com/repos/clone/pingmail" plom
 systemctl daemon-reload
+systemctl enable --now fetchmail_old_account.timer
+systemctl enable --now pingmail.timer
 
 # To allow IMAPS access.
 echo "ssl_cert = </etc/letsencrypt/live/$(hostname -f)/fullchain.pem" > /etc/dovecot/conf.d/99-ssl-certs.conf