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).
This commit is contained in:
Krisztian Kovacs 2022-04-28 13:57:50 +02:00 committed by George Kiagiadakis
parent 7b8e3e8088
commit 8af6f3df1c

View file

@ -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)",