On Tuesday, 26.01.2016 at 21:16, Barbu Paul - Gheorghe wrote: > On 01/26/2016 03:25 PM, Martin Lucina wrote: > > Hi, > > Hello, > > > If no _rc_ key is specified in the configuration, only the first binary > > baked into the unikernel will be invoked, with _argv[]_ set to `[ "rumprun" > > ]`. > > I don't have enough experience with this project to have an opinion, but the > above quote caught my attention. > > Wouldn't it be better if argv was set by default to the baked binary's name > (instead of "rumprun")?
Good catch. The "run the first binary with argv[] == [rumprun]" behaviour is just documenting existing behaviour. I'd like to keep the option of being able to run a unikernel without passing in any configuration, it's (at least) a useful shortcut when you know what you're doing. With the changes to multibake I implemented yesterday, rumprun now has a list of "binname"s which comes from those passed to rumprun-bake, so, I propose to change this case to set argv[] == [binname]. It's not perfect, but better than [rumprun]. > I'm saying this since maybe some existing programs use the argv[0] in some > meaningful way and changing that may break them... Well, if you're baking in a multi-call binary that relies on argv[0] being set to something specific, then by definition you will have to pass the unikernel some configuration to get that behaviour. This behaviour is only for supporting the option of being able to run a unikernel with a single binary with no configuration. Having said that, running a unikernel with *more than 1* binary multibaked into it with no configuration of rc[] does not make sense to me. I propose to change the spec to account for this by refusing to run at all (with an error) if more than 1 binary is baked into the unikernel and no rc[] is passed in the configuration. Thoughts?
