From 8af6f3df1c053b4416a26acf5e207456f9502189 Mon Sep 17 00:00:00 2001 From: Krisztian Kovacs Date: Thu, 28 Apr 2022 13:57:50 +0200 Subject: [PATCH] modules/logind: be more specific when creating the login monitor We're only interested in notifications for user state changes, so we should better be more specific about it when creating the systemd login monitor. This avoids issues with sd_login_monitor_new() returning EINVAL if systemd-machined is not running (and thus /run/systemd/machines does not exist). --- modules/module-logind.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/module-logind.c b/modules/module-logind.c index 57e0c236..7724479e 100644 --- a/modules/module-logind.c +++ b/modules/module-logind.c @@ -71,7 +71,7 @@ wp_logind_enable (WpPlugin * plugin, WpTransition * transition) WpLogind *self = WP_LOGIND (plugin); int res = 0; - if ((res = sd_login_monitor_new (NULL, &self->monitor)) < 0) { + if ((res = sd_login_monitor_new ("uid", &self->monitor)) < 0) { wp_transition_return_error (transition, g_error_new (G_IO_ERROR, g_io_error_from_errno (-res), "failed to start systemd logind monitor: %d (%s)",