Skip to content

Conversation

@vjr
Copy link
Member

@vjr vjr commented Nov 12, 2022

@vjr
Copy link
Member Author

vjr commented Nov 12, 2022

@elementary/desktop-developers

Any suggestions for how to get greeter to restart itself or via restart lightdm?

See the code block starting here: https://github.com/elementary/greeter/pull/624/files#diff-3d3c3150c12cf12f07b12828137c3dc9478f9a12c21ad40905aef57c8e12255aR519

When I try to trigger lightdm restart I get the error "this requires interactive permissions" so any pointers on how to resolve this?

Initial setup uses the systemd hostname1 dbus interface and the methods there have a boolean parameter to set interactive mode false but I couldn't see something similar for the systemd1 dbus interface methods.

I think this draft PR with its current approach might be an acceptable way to resolve the issue but if anyone has a better approach I can give that a shot too.

Thanks!

@danirabbit danirabbit requested a review from tintou November 12, 2022 23:02
@vjr
Copy link
Member Author

vjr commented Nov 13, 2022

I tried (probably incorrectly) to use the sd_bus_set_allow_interactive_authorization () libsystemd API , still get the error.

@tintou

@vjr vjr marked this pull request as ready for review November 25, 2022 07:59
@vjr vjr requested a review from a team November 25, 2022 07:59
@vjr vjr requested review from a team and davidmhewitt December 23, 2022 20:48
@vjr
Copy link
Member Author

vjr commented Dec 23, 2022

@meisenzahl the rules file wasn't working because jammy still has an older version 0.105 of polkit which doesn't support rules/javascript! Came across this while searching the web while troubleshooting the issue.

@vjr vjr requested review from danirabbit and meisenzahl December 23, 2022 21:08
Copy link
Member

@meisenzahl meisenzahl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vjr nice work! Works as intended.

I have some comments where I'm not sure what would be best practice at this place.

@davidmhewitt I would be very happy about another review from you, since you have clearly more knowledge of Polkit 😁

Comment on lines +5 to +6
ResultInactive=no
ResultAny=no
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file ensures that the feature works as desired. However, the two rules are even more open in https://github.com/elementary/initial-setup/blob/master/data/49-io.elementary.initial-setup.pkla. From my point of view, however, we should leave them restricted here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agreed

Comment on lines +29 to +32
install_data(
'io.elementary.greeter.pkla',
install_dir: join_paths(get_option('sharedstatedir'), 'polkit-1', 'localauthority', '10-vendor.d')
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In https://github.com/elementary/initial-setup/blob/master/data/meson.build the pkla file is prefixed with 49. I wonder if we should also prefix the pkla file of Greeter.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest keeping the existing RDNN format as mentioned in the "man pklocalauthority" notes and not prepending with that number. It is already installed into 10-vendor.d which is intended (as the name implies and noted in the manpages) for vendors. But we'll see comments from reviewers.

@vjr vjr self-assigned this Dec 24, 2022
@danirabbit
Copy link
Member

@tintou fixed this with a patch in Lightdm. So we don't need to restart this anymore :)

@danirabbit danirabbit closed this Jan 29, 2023
@lenemter lenemter deleted the fix-double-login branch February 23, 2024 09:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

First login after initial setup fails, subsequent logins work

5 participants