cloudius-systems / osv

OSv, a new operating system for the cloud.
osv.io
Other
4.11k stars 605 forks source link

runscript should complain on error #849

Closed miha-plesko closed 7 years ago

miha-plesko commented 7 years ago

Simple scripts can be run using runscript <path> program that was introduced with this commit. Unfortunately, if we pass invalid path to the program, it does not complain; OSv just hangs forever:

$ capstan run abc --execute "runscript /i/do/not/exist"
Created instance: abc
Setting cmdline: runscript /i/do/not/exist
OSv v0.24-290-g2531d70
eth0: 192.168.122.15
(hangs forever)

Would it be possible to print a message like ERROR: runscript could not find script /i/do/not/exist?

/cc @justinc1

justinc1 commented 7 years ago

Error should be printed, yes.

In addition, maybe whole VM should shutdown. If I try run.py -e '/zpool.so list; asdf; /zpool.so list', then I get:

...
NAME   SIZE  ALLOC   FREE    CAP  DEDUP  HEALTH  ALTROOT
osv   9.94G  7.91M  9.93G     0%  1.00x  ONLINE  -
Failed to load object: asdf. Powering off.

Also, if I try -e "runscript /empty-file; /cli/cli.so", then I think that cli.so should be started (right now, this fails).