e42fd1727f
To aid subman work Related: #RHEL-72584
47 lines
2.1 KiB
Diff
47 lines
2.1 KiB
Diff
From edcdf9c8308653b865a9ebe276cd758da4a62f49 Mon Sep 17 00:00:00 2001
|
|
From: John Eckersberg <jeckersb@redhat.com>
|
|
Date: Fri, 17 Jan 2025 11:32:11 -0500
|
|
Subject: [PATCH] systemd: enable bootc-status-updated.target on startup
|
|
|
|
Any services that react to status changes should be idempotent, and
|
|
should run on boot. It is likely (but not guaranteed) that during
|
|
boot we are in the process of switching from a previous deployment to
|
|
a new one, and thus what was previously "staged" is now "booted" and
|
|
what was previously "booted" is now "rollback", so anything that cares
|
|
about status is going to want to handle that.
|
|
|
|
Signed-off-by: John Eckersberg <jeckersb@redhat.com>
|
|
Signed-off-by: Colin Walters <walters@verbum.org>
|
|
---
|
|
Makefile | 1 +
|
|
systemd/bootc-status-updated.target | 4 ++++
|
|
2 files changed, 5 insertions(+)
|
|
|
|
diff --git a/Makefile b/Makefile
|
|
index 3809c4b9..dbb1d7d7 100644
|
|
--- a/Makefile
|
|
+++ b/Makefile
|
|
@@ -27,6 +27,7 @@ install:
|
|
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
|
|
+ ln -s ../bootc-status-updated.target $(DESTDIR)/$(prefix)/lib/systemd/system/multi-user.target.wants/bootc-status-updated.target
|
|
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
|
|
diff --git a/systemd/bootc-status-updated.target b/systemd/bootc-status-updated.target
|
|
index a0c13417..2c159468 100644
|
|
--- a/systemd/bootc-status-updated.target
|
|
+++ b/systemd/bootc-status-updated.target
|
|
@@ -2,3 +2,7 @@
|
|
Description=Target for bootc status changes
|
|
Documentation=man:bootc-status-updated.target(8)
|
|
StopWhenUnneeded=true
|
|
+ConditionPathExists=/run/ostree-booted
|
|
+
|
|
+[Install]
|
|
+WantedBy=multi-user.target
|
|
--
|
|
2.47.0
|
|
|