Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> --- NEWS.rst | 7 +++++++ docs/hooks.rst | 10 ++++++++++ 2 files changed, 17 insertions(+) diff --git a/NEWS.rst b/NEWS.rst index 6ffc803118c2..2acba86f3896 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -17,6 +17,13 @@ v12.9.0 (unreleased) * **New features** + * hooks: Support user-level hook scripts for session daemons + + Session daemons now search for hook scripts in + ``$XDG_CONFIG_HOME/libvirt/hooks/`` (typically + ``~/.config/libvirt/hooks/``) in addition to the system-wide + ``/etc/libvirt/hooks/`` directory. + * **Improvements** * **Bug fixes** diff --git a/docs/hooks.rst b/docs/hooks.rst index e1745b8cc71d..68166474d53f 100644 --- a/docs/hooks.rst +++ b/docs/hooks.rst @@ -37,6 +37,16 @@ The libvirt hook scripts are located in the directory - :since:`Since 6.5.0`, you can also place several hook scripts in the directories ``/etc/libvirt/hooks/<driver>.d/``. +:since:`Since 12.9.0`, for non-root (session) daemons, hooks are also searched +in the user configuration directory ``$XDG_CONFIG_HOME/libvirt/hooks/`` +(typically ``~/.config/libvirt/hooks/``). When both directories exist, the +system hooks (``/etc/libvirt/hooks/``) are executed first, followed by the user +hooks. Output from the system hooks is chained as input to the user hooks. + +The system-wide hook directory can be skipped for session daemons by setting +``skip_system_hooks = 1`` in the daemon configuration file (e.g. +``virtqemud.conf``). When enabled, only the user directory is searched. + To use hook scripts, you will need to create this ``hooks`` directory manually, place the desired hook scripts inside, then make them executable. -- 2.56.0.rc0.29.g47ce80527c56