UCLALibrary / packer-samvera

A build of Samvera/Hyrax using Packer and the 'ansible-samvera' roles
BSD 3-Clause "New" or "Revised" License
1 stars 3 forks source link

`vagrant halt` fails, probably because `shutdown -h now` is not run as root #55

Closed sourcefilter closed 5 years ago

sourcefilter commented 5 years ago
andy@YRL-ML-DLP704:californica$ vagrant halt
==> default: Attempting graceful shutdown of VM...
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

shutdown -h now

Stdout from the command:

Stderr from the command:

bash: line 5: shutdown: command not found

Forgot to take notes, but shutdown now -h inside the VM shell fails with a similar "command not found" message. sudo shutdown now -h works, but I assume there's other vagrant stuff (like w/ the sshfs mount) that might not get done.

So, acceptance criteria (now that the problem is understood):

ksclarke commented 5 years ago

[vagrant@localhost ~]$ shutdown -h now ==== AUTHENTICATING FOR org.freedesktop.login1.power-off === Authentication is required for powering off the system. Authenticating as: vagrant Password:

ksclarke commented 5 years ago

The code to fix this is in https://github.com/UCLALibrary/uclalib_role_samvera_capdeploy/pull/29 but in talking with Stephen we decided to break this out into its own role. So, I'll write an Ansible role that will handle stuff specific to the developer's box.

ksclarke commented 5 years ago

Just dropping this bit of documentation in here so it's not forgotten: https://blog.learningtree.com/policykit-authentication-framework-creating-rules/

ksclarke commented 5 years ago

Do a vagrant box update to download the latest version with this fix. Auto-updates for boxes are turned off by default.