Skip to content

Commit 1284cba

Browse files
committed
systemd: New bootc-apply.{timer,service}
Let's ship a baseline systemd unit that can be enabled for automatic updates. Signed-off-by: Colin Walters <walters@verbum.org>
1 parent 1477166 commit 1284cba

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ all-test:
99
install:
1010
install -D -m 0755 -t $(DESTDIR)$(prefix)/bin target/release/bootc
1111
install -d $(DESTDIR)$(prefix)/lib/bootc/install
12+
install -D -m 0644 -t $(DESTDIR)/$(prefix)/lib/systemd/system systemd/*.service systemd/*.timer
1213
if test -d man; then install -D -m 0644 -t $(DESTDIR)$(prefix)/share/man/man8 man/*.8; fi
1314

1415
bin-archive: all

systemd/bootc-apply.service

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[Unit]
2+
Description=Apply bootc updates
3+
Documentation=man:bootc(8)
4+
ConditionPathExists=/run/ostree-booted
5+
6+
[Service]
7+
Type=oneshot
8+
ExecStart=bootc update --apply --quiet
9+

systemd/bootc-apply.timer

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[Unit]
2+
Description=Apply bootc updates
3+
Documentation=man:bootc(8)
4+
ConditionPathExists=/run/ostree-booted
5+
6+
[Timer]
7+
OnBootSec=1h
8+
# This time is relatively arbitrary and obviously expected to be overridden/changed
9+
OnUnitInactiveSec=8h
10+
11+
[Install]
12+
WantedBy=timers.target

0 commit comments

Comments
 (0)