Skip to content

Commit

Permalink
Merge pull request #1009 from cgwalters/path-enabled
Browse files Browse the repository at this point in the history
Two changes for `bootc-status-updated.path`
  • Loading branch information
cgwalters authored Jan 7, 2025
2 parents 38e6528 + 4efcf52 commit ac27e42
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ install:
fi; \
done
install -D -m 0644 -t $(DESTDIR)/$(prefix)/lib/systemd/system systemd/*.service systemd/*.timer systemd/*.path systemd/*.target
install -d -m 0755 $(DESTDIR)/$(prefix)/lib/systemd/system/multi-user.target.wants
ln -s ../bootc-status-updated.path $(DESTDIR)/$(prefix)/lib/systemd/system/multi-user.target.wants/bootc-status-updated.path
install -D -m 0644 -t $(DESTDIR)/$(prefix)/share/doc/bootc/baseimage/base/usr/lib/ostree/ baseimage/base/usr/lib/ostree/prepare-root.conf
install -d -m 755 $(DESTDIR)/$(prefix)/share/doc/bootc/baseimage/base/sysroot
cp -PfT baseimage/base/ostree $(DESTDIR)/$(prefix)/share/doc/bootc/baseimage/base/ostree
Expand Down
1 change: 1 addition & 0 deletions systemd/bootc-status-updated.path
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[Unit]
Description=Monitor bootc for status changes
Documentation=man:bootc-status-updated.path(8)
ConditionPathExists=/run/ostree-booted

[Path]
PathChanged=/ostree/bootc
Expand Down
18 changes: 18 additions & 0 deletions tests/booted/readonly/012-unit-status.nu
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Verify our systemd units are enabled
use std assert
use tap.nu

tap begin "verify our systemd units"

let units = [
["unit", "status"];
# This one should be always enabled by our install logic
["bootc-status-updated.path", "active"]
]

for elt in $units {
let found_status = systemctl show -P ActiveState $elt.unit | str trim
assert equal $elt.status $found_status
}

tap ok

0 comments on commit ac27e42

Please sign in to comment.