Skip to content

Commit

Permalink
systemd: New bootc-fetch-apply-updates.{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 6, 2023
1 parent 1477166 commit c035eff
Show file tree
Hide file tree
Showing 3 changed files with 21 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
8 changes: 8 additions & 0 deletions systemd/bootc-fetch-apply-updates.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[Unit]
Description=Apply bootc updates
Documentation=man:bootc(8)
ConditionPathExists=/run/ostree-booted

[Service]
Type=oneshot
ExecStart=/usr/bin/bootc update --apply --quiet
12 changes: 12 additions & 0 deletions systemd/bootc-fetch-apply-updates.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 c035eff

Please sign in to comment.