wilas / vbkick

Tool for building and maintaining VirtualBox VMs described as a code in a single definition file.
Other
8 stars 5 forks source link

Tries to kill webserver too many times on OSX #21

Closed alanpearce closed 10 years ago

alanpearce commented 10 years ago

At the end of a vbkick build, I get

Sleeping 180 seconds ...
Stopping webserver...
/usr/local/bin/vbkick: line 1027: kill: (12991) - No such process
WARNING: problem with stopping webserver. Kill proces manually
INFO: Signal/Error handler - cleanup before exiting...
Stopping webserver...
/usr/local/bin/vbkick: line 1027: kill: (12991) - No such process

I don't know how it's being closed beforehand, but it seems to work just fine during the build. :)

No such issue on FreeBSD.

wilas commented 10 years ago

kill $web_pid command fail (because given pid not exist), so error signal is process in clean_up function, where once more kill is used to deal with webserver. Interesting is why pid is wrong.

wilas commented 10 years ago

Info about PID is now displayed during build process it should help debug the problem.

$ vbkick build foo
webserver has been started (pid 31391)
...
Stopping webserver (pid 31391)

After starting webserver please try on another terminal (and note PID related to webserver):

$ ps -ef | grep python 
wilas commented 10 years ago

After #27 vbkick shouldn't try to kill webserver more than once. webserver_status is updated as well faster to avoid unconsistency when SIGTERM, SIGINT is sent (e.g. pressed ctrl+c by the user).

I'm curious what return that command during the building process (maybe macOSX has problem with ps -ef):

$ ps -ef | grep "python -m $webserver_module $kickstart_port" | grep -v grep
or (simpler)
$ ps -ef | python

Note: #25 introduce the new option - webserver_disabled, which prevent local webserver from starting. Useful for definition where local webserver is not needed, like for SmartOS.

alanpearce commented 10 years ago

It seems to be fine now. Funny, I was actually booting SmartOS but I had no idea that the webserver wasn't needed :)

wilas commented 10 years ago

I'm glad that it work for you :)