aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile2
-rw-r--r--systemd/pacman-offline-reboot.service7
-rw-r--r--systemd/pacman-offline-reboot.timer10
3 files changed, 19 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 221346a..f19f2d5 100644
--- a/Makefile
+++ b/Makefile
@@ -22,6 +22,8 @@ install:
$(INSTALL) -D -m0755 systemd/pacman-offline $(DESTDIR)/usr/lib/systemd/scripts/pacman-offline
$(INSTALL) -D -m0644 systemd/pacman-offline-prepare.service $(DESTDIR)/usr/lib/systemd/system/pacman-offline-prepare.service
$(INSTALL) -D -m0644 systemd/pacman-offline-prepare.timer $(DESTDIR)/usr/lib/systemd/system/pacman-offline-prepare.timer
+ $(INSTALL) -D -m0644 systemd/pacman-offline-reboot.service $(DESTDIR)/usr/lib/systemd/system/pacman-offline-reboot.service
+ $(INSTALL) -D -m0644 systemd/pacman-offline-reboot.timer $(DESTDIR)/usr/lib/systemd/system/pacman-offline-reboot.timer
$(INSTALL) -d -m0755 $(DESTDIR)/usr/lib/systemd/system/system-update.target.wants/
$(LN) -s ../pacman-offline.service $(DESTDIR)/usr/lib/systemd/system/system-update.target.wants/pacman-offline.service
diff --git a/systemd/pacman-offline-reboot.service b/systemd/pacman-offline-reboot.service
new file mode 100644
index 0000000..bb7a44f
--- /dev/null
+++ b/systemd/pacman-offline-reboot.service
@@ -0,0 +1,7 @@
+[Unit]
+Description=Reboot for pacman offline system-update
+ConditionPathExists=/system-update
+
+[Service]
+Type=oneshot
+ExecStart=/usr/bin/systemctl reboot
diff --git a/systemd/pacman-offline-reboot.timer b/systemd/pacman-offline-reboot.timer
new file mode 100644
index 0000000..b958b84
--- /dev/null
+++ b/systemd/pacman-offline-reboot.timer
@@ -0,0 +1,10 @@
+[Unit]
+Description=Reboot for pacman offline system-update
+ConditionPathExists=/system-update
+
+[Timer]
+OnCalendar=03:00:00
+RandomizedDelaySec=2hours
+
+[Install]
+WantedBy=timers.target