solo-io / unik

The Unikernel & MicroVM Compilation and Deployment Platform
Apache License 2.0
2.72k stars 191 forks source link

Daemon deletes /tmp folder on first start #83

Closed miha-plesko closed 8 years ago

miha-plesko commented 8 years ago

I run unik like this:

cd $UNIK_DIR
make binary
cd _build
sudo ./unik daemon --debug

But I've noticed that after the first run, my /tmp folder goes missing! Daemon log seems to be in order, last few lines are:

INFO[0029] listening for udp heartbeat...               
INFO[0029] UDP Server listening on 0.0.0.0:9876         
INFO[0030] received an ip from 192.168.58.3 with data: unik_virtualbox:192.168.58.3 
INFO[0030] Bootstrapping provider qemu with config {my-qemu false 0} 
INFO[0030] listening on :3001                           
WARN[0030] failed to read qemu state file at /home/miha/.unik/qemu/state.json, creating blank qemu state  error=[state/base_state.go:36] error reading save file /home/miha/.unik/qemu/state.json: {open /home/miha/.unik/qemu/state.json: no such file or directory}
[martini] listening on :3000 (development)

I must then manually create /tmp directory and assign it 1777 permission for my Ubuntu16.04 system to continue working properly.

NOTE: Once I manually recreate /tmp dir, I can re-build and re-run unik as many times as I want to without affecting the '/tmp' directory again.

Is this a unik bug, or is it my system?

ingve commented 8 years ago

Very interesting. I've noticed that lately, when running on OS X, my ~/.unik/tmp folder gets deleted, either when starting the daemon or when the virtualbox instance listener is built for the first time. All subsequent unik build commands fail, until manually creating a new tmp folder inside ~/.unik, after which all unik build commands work as expected.

ilackarms commented 8 years ago

just reproduced this.. investigating

ilackarms commented 8 years ago

found the bug.. https://github.com/emc-advanced-dev/unik/blob/master/pkg/providers/virtualbox/deploy_instance_listener.go#L79

when we create the instance listener's data volume (which only happens on the very first boot of the instance listener) we remove the directory containing the tmp image file (rather than just the image file). whoopsies. thank you for this find!

pushing a fix now