Skip to content

Commit 82d8939

Browse files
committed
systemd: Add bootc-status-updated.{path,target} units
This adds a new systemd path unit which activates on bootc status changing, and in turn triggers a new systemd target. This allows adding arbitrary new systemd services with `WantedBy = bootc-status-updated.target` that will be activated each time the bootc status is updated. Signed-off-by: John Eckersberg <[email protected]>
1 parent a78b8ae commit 82d8939

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ install:
2424
install -D -m 0644 -t $(DESTDIR)$(prefix)/share/man/man8 $$d/*.8; \
2525
fi; \
2626
done
27-
install -D -m 0644 -t $(DESTDIR)/$(prefix)/lib/systemd/system systemd/*.service systemd/*.timer
27+
install -D -m 0644 -t $(DESTDIR)/$(prefix)/lib/systemd/system systemd/*.service systemd/*.timer systemd/*.path systemd/*.target
2828

2929
# Run this to also take over the functionality of `ostree container` for example.
3030
# Only needed for OS/distros that have callers invoking `ostree container` and not bootc.

systemd/bootc-status-updated.path

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[Unit]
2+
Description=Monitor bootc for status changes
3+
Documentation=man:bootc(8)
4+
5+
[Path]
6+
PathChanged=/ostree/bootc
7+
Unit=bootc-status-updated.target
8+
9+
[Install]
10+
WantedBy=multi-user.target
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[Unit]
2+
Description=Target for bootc status changes
3+
Documentation=man:bootc(8)
4+
StopWhenUnneeded=true

0 commit comments

Comments
 (0)