[PATCH v2] systemd: fall back to default system-sleep dir without systemd-devel

Mykola Kvach posted 1 patch 5 days, 13 hours ago
m4/systemd.m4 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH v2] systemd: fall back to default system-sleep dir without systemd-devel
Posted by Mykola Kvach 5 days, 13 hours ago
From: Mykola Kvach <mykola_kvach@epam.com>

Keep the pkg-config lookup for SYSTEMD_SLEEP_DIR, but fall back to
"$(prefix)/lib/systemd/system-sleep/" if the variable remains unset.
This avoids reintroducing a build-time dependency on systemd-devel while
still honoring the path provided by pkg-config when present.

Fixes: e54a6cd6a1f3 ("systemd: Add hooks to stop/start xen-watchdog on suspend/resume")
Reported-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Mykola Kvach <mykola_kvach@epam.com>
---
Build in which the regression was detected:
https://gitlab.com/xen-project/people/marmarek/xen/-/jobs/10959608099
---
 m4/systemd.m4 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/m4/systemd.m4 b/m4/systemd.m4
index c47a25ef93..5fb5a7089e 100644
--- a/m4/systemd.m4
+++ b/m4/systemd.m4
@@ -81,7 +81,7 @@ AC_DEFUN([AX_CHECK_SYSTEMD_LIBS], [
 	], [])
 
 	AS_IF([test "x$SYSTEMD_SLEEP_DIR" = x], [
-	    AC_MSG_ERROR([SYSTEMD_SLEEP_DIR is unset])
+	    SYSTEMD_SLEEP_DIR="\$(prefix)/lib/systemd/system-sleep/"
 	], [])
 ])
 
-- 
2.43.0


Re: [PATCH v2] systemd: fall back to default system-sleep dir without systemd-devel
Posted by Andrew Cooper 5 days, 13 hours ago
On 05/12/2025 4:07 pm, Mykola Kvach wrote:
> From: Mykola Kvach <mykola_kvach@epam.com>
>
> Keep the pkg-config lookup for SYSTEMD_SLEEP_DIR, but fall back to
> "$(prefix)/lib/systemd/system-sleep/" if the variable remains unset.
> This avoids reintroducing a build-time dependency on systemd-devel while
> still honoring the path provided by pkg-config when present.
>
> Fixes: e54a6cd6a1f3 ("systemd: Add hooks to stop/start xen-watchdog on suspend/resume")
> Reported-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
> Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
> Signed-off-by: Mykola Kvach <mykola_kvach@epam.com>
> ---
> Build in which the regression was detected:
> https://gitlab.com/xen-project/people/marmarek/xen/-/jobs/10959608099
> ---
>  m4/systemd.m4 | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/m4/systemd.m4 b/m4/systemd.m4
> index c47a25ef93..5fb5a7089e 100644
> --- a/m4/systemd.m4
> +++ b/m4/systemd.m4
> @@ -81,7 +81,7 @@ AC_DEFUN([AX_CHECK_SYSTEMD_LIBS], [
>  	], [])
>  
>  	AS_IF([test "x$SYSTEMD_SLEEP_DIR" = x], [
> -	    AC_MSG_ERROR([SYSTEMD_SLEEP_DIR is unset])
> +	    SYSTEMD_SLEEP_DIR="\$(prefix)/lib/systemd/system-sleep/"
>  	], [])
>  ])
>  

Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>

Thanks.