Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: don't run reboot with sudo on Linux with systemd #866

Merged
merged 1 commit into from
Jul 20, 2024

Conversation

SteveLauC
Copy link
Member

What does this PR do

Based on the discussion in #861, on Linux with systemd, reboot can be invoked without sudo, this PR implements it.

Closes #861.

Standards checklist

  • The PR title is descriptive.
  • I have read CONTRIBUTING.md
  • Optional: I have tested the code myself

For new steps

  • Optional: Topgrade skips this step where needed
  • Optional: The --dry-run option works with this step
  • Optional: The --yes option works with this step if it is supported by
    the underlying command

If you developed a feature or a bug fix for someone else and you do not have the
means to test it, please tag this person here.

@SteveLauC SteveLauC force-pushed the feat/reboot_without_sudo branch from 2dc15d8 to 232f056 Compare July 16, 2024 11:47
@SteveLauC
Copy link
Member Author

cc @matkeith, here is a build for Linux with this patch included, welcome to give it a test.

@matkeith
Copy link

This did not work for me. I got a crash before the reboot phase
topgrade output.txt
output attached

@SteveLauC
Copy link
Member Author

topgrade output.txt

Thanks for testing it! This crash is not related to this PR, it is caused by the waydroid step, please disable it and topgrade again :

$ ./topgrade --disable waydroid

@SteveLauC
Copy link
Member Author

Regarding that waydroid issue, could you please provide the ouput of:

$ waydroid status

@matkeith
Copy link

here's the waydroid status. makes sense
matkeith@mattlaptop:~/Downloads$ waydroid status
ERROR: WayDroid is not initialized, run "waydroid init"

disabling waydroid let the update work but i was never prompted for a reboot to try it. output attached
topgrade output 2.txt

i'm running the topgrade file as an exe as my own user, i assume this is good enough?

@SteveLauC
Copy link
Member Author

Use a shell that has not sudo privilege cached, i.e., haven't executed sudo recently, then run:

$ topgrade --dry-run --keep

Since it is a dry-run, you should see the following result, then type R to reboot your PC (Warning: it reboots your PC)

Screenshot 2024-07-20 at 9 13 04 AM

@matkeith
Copy link

that worked =) rebooted successfully!

@SteveLauC
Copy link
Member Author

ERROR: WayDroid is not initialized, run "waydroid init"

Can you execute waydroid init, then run waydroid status again?

@SteveLauC SteveLauC merged commit dceb697 into topgrade-rs:main Jul 20, 2024
11 checks passed
@SteveLauC SteveLauC deleted the feat/reboot_without_sudo branch July 20, 2024 02:13
@matkeith
Copy link

matkeith commented Jul 20, 2024

sure.

here's the error


matkeith@mattlaptop:~$ sudo waydroid init
[sudo] password for matkeith: 
[19:14:27] ERROR: Failed to get system OTA channel: /lineage/waydroid_x86_64/VANILLA.json, error: -1
[19:14:27] See also: <https://github.com/waydroid>
Run 'waydroid log' for details.
matkeith@mattlaptop:~$ waydroid status
ERROR: WayDroid is not initialized, run "waydroid init"

i haven't used waydroid, only installed it in the possibility of using it in the future ...- but considering it isnt working i might just remove it from bazzite and simplify the issue

@SteveLauC
Copy link
Member Author

Thanks for providing the output, I have created an issue in Topgrade for this: #869

@SteveLauC SteveLauC mentioned this pull request Oct 6, 2024
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for systemd's systemctl reboot for passwordless reboots
2 participants