sysupdate: notify hook subscribers after a successful update
Define a new io.systemd.SysUpdate.Notify Varlink interface with a single OnCompletedUpdate() method, and after sysupdate successfully installs an update, invoke that method on every socket linked into /run/systemd/sysupdate/notify/ via varlink_execute_directory(). This gives other components a hook to react to applied updates (e.g. recompute a TPM policy, link a freshly downloaded kernel, refresh extensions). The notification carries the component name, the installed version and the list of updated resources (transfer id + on-disk path). Subscribers are free to ignore the parameters and just treat the call as a trigger. Setting SYSTEMD_SYSUPDATE_FORCE_NOTIFY=1 forces the notification to be sent even when no update was applied (in which case no resource list is included), so follow-up work can be triggered unconditionally. Fixes: #35988
This commit is contained in:
@@ -51,6 +51,7 @@
|
||||
#include "varlink-io.systemd.Resolve.Monitor.h"
|
||||
#include "varlink-io.systemd.Shutdown.h"
|
||||
#include "varlink-io.systemd.StorageProvider.h"
|
||||
#include "varlink-io.systemd.SysUpdate.Notify.h"
|
||||
#include "varlink-io.systemd.Udev.h"
|
||||
#include "varlink-io.systemd.Unit.h"
|
||||
#include "varlink-io.systemd.UserDatabase.h"
|
||||
@@ -227,6 +228,7 @@ TEST(parse_format) {
|
||||
&vl_interface_io_systemd_Resolve_Monitor,
|
||||
&vl_interface_io_systemd_Shutdown,
|
||||
&vl_interface_io_systemd_StorageProvider,
|
||||
&vl_interface_io_systemd_SysUpdate_Notify,
|
||||
&vl_interface_io_systemd_Udev,
|
||||
&vl_interface_io_systemd_Unit,
|
||||
&vl_interface_io_systemd_UserDatabase,
|
||||
|
||||
Reference in New Issue
Block a user