Elektrobit / flake-pilot

Registration/Control utility for applications launched through a runtime-engine, e.g containers
MIT License
10 stars 6 forks source link

Fixed sci setup and command execution #80

Closed schaefi closed 1 year ago

schaefi commented 1 year ago

sci was a bit too picky on mounting proc, sys and run. If called from within an initrd it could happen that these mountpoints already exists. I turned this condition into a warning rather an error. Furthermore sci executes itself when the idea was that sci executes a given command. I refactored the code to allow calling a given command and also let the firecracker instance shut down after the command execution. The code also leaves two TODO code points which I'd like to fix later and together with the team

schaefi commented 1 year ago

@m-kat I did some intense testing with sci, overlays and running arbitrary commands through sci. I stumbled over several issues and created this pull request as a suggestion to fix them. Thanks

schaefi commented 1 year ago

@m-kat I'm sorry the PR is not easy to read as I also needed to refactor the code flow a bit. I think it's best if you just look at the complete source file. It's still a small source file and I think easier to read compared to the diff. Hope that's ok for you. Thanks

schaefi commented 1 year ago

I found another small issue and need to refactor a bit... don't merge please. Thanks

schaefi commented 1 year ago

ok done now :)

schaefi commented 1 year ago

@m-kat with the last change we can safely pass program arguments to our command call without interfering with other components of the system reading from /proc/cmdline. To specify a call through sci you now set:

init=/usr/sbin/sci run="program --and its --arguments"

The parsing is done by rust's shell_words crate, really a good one. Thanks