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

Support defining a custom reboot command #467

Merged

Conversation

pbolduc
Copy link
Contributor

@pbolduc pbolduc commented Mar 4, 2024

Proposed Changes

This change adds an optional custom_reboot_command. On Diet Pi, there is no dbus installed. See Diet Pi Release Notes.

DietPi ships without dbus and with logind masked by default, as we do not see their features being used on a typical DietPi system. Instead, dbus is installed and logind unmasked on demand on certain software installs or when chosen via dietpi.txt. However, the newer systemd version since Bookworm attempts dbus > logind communication in any case when calling poweroff/reboot/halt, despite no wall message being sent, e.g. to handle shutdown inhibitors (like open SSH session being able to prevent shutdown), and throws errors if either dbus is not reachable or logind not running. Until in case dbus or logind are further tied into common system commands or features, we solved the issue by creating shell functions for poweroff/reboot/halt which call the respective systemd target directly to bypass logind (and hence dbus), but fall back to the original commands, depending on given command-line parameters.

If custom_reboot_command is defined, the reboot_command parameter will be passed to the ansible.builtin.reboot module. If custom_reboot_command is not defined, then reboot_command is omitted and the default behavior occurs.

  • Add commented out variable to sample/group_vars/all.yml with comments
  • Add reboot_command: "{{ custom_reboot_command | default(omit) }}" to each reboot module usage.

Fixes one problem in #463

Checklist

  • Tested locally
  • Ran site.yml playbook
  • Ran reset.yml playbook
  • Did not add any unnecessary changes
  • Ran pre-commit install at least once before committing
  • 🚀

@pbolduc
Copy link
Contributor Author

pbolduc commented Mar 4, 2024

Is this workflow failure a transient issue? Dont understand why adding optional reboot command would cause,

INFO     Pruning extra files from scenario ephemeral directory
Error: Process completed with exit code 1.

@timothystewart6
Copy link
Contributor

Is this workflow failure a transient issue? Dont understand why adding optional reboot command would cause,

INFO     Pruning extra files from scenario ephemeral directory
Error: Process completed with exit code 1.

Yes, this happens a lot with the ipv6 test. Going to update a few things in a PR. If this keeps happening I am leaning towards disabling that test.

@timothystewart6 timothystewart6 enabled auto-merge (squash) March 6, 2024 02:51
@timothystewart6 timothystewart6 merged commit f81ec04 into techno-tim:master Mar 6, 2024
9 checks passed
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.

2 participants