vagrant-landrush / landrush

A Vagrant plugin that provides a simple DNS server for Vagrant guests
MIT License
666 stars 78 forks source link

Landrush kill not working in Windows environment #202

Closed cinkonaap closed 8 years ago

cinkonaap commented 8 years ago

Hey,

I am trying to use Landrush in Windows environment, but I got this error why trying to execute vagrant landrush stop.

.vagrant.d/gems/gems/landrush-1.0.0/lib/landrush/server.rb:224:in `kill': Invalid argument (Errno::EINVAL)

from .vagrant.d/gems/gems/landrush-1.0.0/lib/landrush/server.rb:224:in `terminate_process'
from .vagrant.d/gems/gems/landrush-1.0.0/lib/landrush/server.rb:98:in `stop'
from .vagrant.d/gems/gems/landrush-1.0.0/lib/landrush/command.rb:16:in `execute'
from c:/Environments/Vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/cli.rb:42:in `execute'
from c:/Environments/Vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/environment.rb:302:in `cli'
from c:/Environments/Vagrant/embedded/gems/gems/vagrant-1.8.4/bin/vagrant:174:in `<main>'
hferentschik commented 8 years ago

@cinkonaap Which version of Windows are you using? Was it just the kill which was not working? Did the Landrush server otherwise come up? Can you try starting and stopping it again:

$ vagrant landrush start
$ vagrant landrush stop

Can you check vagrant landrush status and try to find the reported pid in the task manager. Try killing the process from the task manager and then back to using Vagrant commands.

FYI, just trying to get some more information around this, in order to re-produce the issue.

cinkonaap commented 8 years ago

After clean restart, without using VirtualBox nor vagrant up, i just hit vagrant landrush start and then vagrant landrush stop.

I gets:

Stopping daemon...
Sending KILL to process 9564...
C:/Users/me/.vagrant.d/gems/gems/landrush-1.0.0/lib/landrush/server.rb:236:in `kill': No such process (Errno::ESRCH)

Some information about my environment:

OS: Windows 10
VirtualBox: 5.0.22 r 108108
Vagrant: 1.8.4
hferentschik commented 8 years ago

Thanks, I've seen this as well once. I made some changes to the Windows process creation and termination which I think will fix the issue. These changes are already part of this pull request. Maybe you can test a temp build?

hferentschik commented 8 years ago

@cinkonaap Would you mind trying the 1.1.0.beta1 release for me?

$ vagrant plugin install landrush --plugin-version 1.1.0.beta.1

I am wondering whether this version will fix your issue?

cinkonaap commented 8 years ago

Seems to work like a charm :+1:. Thanks

hferentschik commented 8 years ago

Fixed by changes made for issue #171