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

ensure vagrant halt terminates with a clean and correct exit code for haiku guests #9557

Closed
wants to merge 1 commit into from
Closed

ensure vagrant halt terminates with a clean and correct exit code for haiku guests #9557

wants to merge 1 commit into from

Conversation

mcandre
Copy link

@mcandre mcandre commented Mar 11, 2018

The current Haiku guest plugin has vagrant halt exiting with a non-zero, failing exit code, as a result of how the /bin/shutdown program behaves in Haiku OS: It exits with value 2 rather than 0. When this happens, any programs measuring the exit value of vagrant halt will get the wrong impression, that Vagrant was unable to successfully halt the VM, when in fact, Vagrant was able to successfully halt the VM. This mistake compounds when Vagrant is integrated with other command line programs, and even worse, Vagrant's own commands such as vagrant package suffer early terminations as a result of the misleading exit status during the halt stage.

I'm adding a -s flag to shutdown, as this triggers an SSH disconnection error which the Haiku guest plugin already identifies as a non-error, so that the overall vagrant halt exit status is accurate.

mcandre pushed a commit to mcandre/packer-templates that referenced this pull request Mar 11, 2018
@kallisti5
Copy link
Contributor

shutdown -s runs syncronously and makes shutdown only return if canceled.
Looks good to me?

There are new "official" haiku images available here:
https://app.vagrantup.com/haiku-os

I tried to get the "haiku" name for the base images, but was turned down by hashicorp with a "first come first served" response. (even though current "haiku" user not using it :-|)

@hashicorp-cla
Copy link

hashicorp-cla commented Jan 15, 2019

CLA assistant check
All committers have signed the CLA.

@briancain
Copy link
Member

Hey all -

Apologies for how long it took for us to address this pull request. Based on my testing, this pull request is no longer required. I was able to bring up a haiku box and halt the machine without any issue:

brian@localghost:vagrant-sandbox % be vagrant up haiku                                                   ±[●][master]
Bringing machine 'haiku' up with 'virtualbox' provider...
==> haiku: Importing base box 'haiku-os/r1beta1-x86_64'...
==> haiku: Matching MAC address for NAT networking...
==> haiku: Checking if box 'haiku-os/r1beta1-x86_64' version '20181127' is up to date...
==> haiku: Setting the name of the VM: vagrant-sandbox_haiku_1573597262040_84459
==> haiku: Fixed port collision for 22 => 2222. Now on port 2200.
==> haiku: Clearing any previously set network interfaces...
==> haiku: Preparing network interfaces based on configuration...
    haiku: Adapter 1: nat
==> haiku: Forwarding ports...
    haiku: 22 (guest) => 2200 (host) (adapter 1)
==> haiku: Booting VM...
==> haiku: Waiting for machine to boot. This may take a few minutes...
    haiku: SSH address: 127.0.0.1:2200
    haiku: SSH username: vagrant
    haiku: SSH auth method: private key
    haiku:
    haiku: Vagrant insecure key detected. Vagrant will automatically replace
    haiku: this with a newly generated keypair for better security.
    haiku:
    haiku: Inserting generated public key within guest...
    haiku: Removing insecure key from the guest if it's present...
    haiku: Key inserted! Disconnecting and reconnecting using new SSH key...
==> haiku: Machine booted and ready!
==> haiku: Checking for guest additions in VM...
    haiku: No guest additions were detected on the base box for this VM! Guest
    haiku: additions are required for forwarded ports, shared folders, host only
    haiku: networking, and more. If SSH fails on this machine, please install
    haiku: the guest additions and repackage the box to continue.
    haiku:
    haiku: This is not an error message; everything may continue to work properly,
    haiku: in which case you may ignore this message.
brian@localghost:vagrant-sandbox % be vagrant halt haiku                                                 ±[●][master]
==> haiku: Attempting graceful shutdown of VM...
brian@localghost:vagrant-sandbox % be vagrant status haiku                                               ±[●][master]
Current machine states:

haiku                     poweroff (virtualbox)

The VM is powered off. To restart the VM, simply run `vagrant up`

If you think this pull request is still valid, please open a new one and we will be happy to address it. Thanks!

@briancain briancain closed this Nov 12, 2019
@ghost
Copy link

ghost commented Jan 28, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Jan 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants