diff --git a/Makefile b/Makefile index 5f072b022..dbada38e6 100644 --- a/Makefile +++ b/Makefile @@ -9,6 +9,7 @@ all-test: install: install -D -m 0755 -t $(DESTDIR)$(prefix)/bin target/release/bootc install -d $(DESTDIR)$(prefix)/lib/bootc/install + install -D -m 0644 -t $(DESTDIR)/$(prefix)/lib/systemd/system systemd/*.service systemd/*.timer if test -d man; then install -D -m 0644 -t $(DESTDIR)$(prefix)/share/man/man8 man/*.8; fi bin-archive: all diff --git a/systemd/bootc-apply.service b/systemd/bootc-apply.service new file mode 100644 index 000000000..64229ed96 --- /dev/null +++ b/systemd/bootc-apply.service @@ -0,0 +1,9 @@ +[Unit] +Description=Apply bootc updates +Documentation=man:bootc(8) +ConditionPathExists=/run/ostree-booted + +[Service] +Type=oneshot +ExecStart=bootc update --apply --quiet + diff --git a/systemd/bootc-apply.timer b/systemd/bootc-apply.timer new file mode 100644 index 000000000..4ad60cbbc --- /dev/null +++ b/systemd/bootc-apply.timer @@ -0,0 +1,12 @@ +[Unit] +Description=Apply bootc updates +Documentation=man:bootc(8) +ConditionPathExists=/run/ostree-booted + +[Timer] +OnBootSec=1h +# This time is relatively arbitrary and obviously expected to be overridden/changed +OnUnitInactiveSec=8h + +[Install] +WantedBy=timers.target