Skip to content

Commit

Permalink
systemd: New bootc-apply.{timer,service}
Browse files Browse the repository at this point in the history
Let's ship a baseline systemd unit that can be enabled
for automatic updates.

Signed-off-by: Colin Walters <walters@verbum.org>
  • Loading branch information
cgwalters committed Nov 3, 2023
1 parent 1477166 commit 1284cba
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions systemd/bootc-apply.service
Original file line number Diff line number Diff line change
@@ -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

12 changes: 12 additions & 0 deletions systemd/bootc-apply.timer
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 1284cba

Please sign in to comment.