Question about start scripts
bajankristof opened this issue · comments
Hi,
I've been developing a cuttlefish plugin for rebar3 lately and it got me thinking about some things regarding relx.
Have you ever thought about instead of having multiple start scripts, just providing an interpreted escript as a single start script and only having os specific scripts for executing this escript.
This would work by locating the escript executable in the included or installed ERTS directory in the os specific scripts and then calling the interpreted escript using the executable.
The way I see it (which might be incomplete) this would introduce the benefit of the start script working the same on all operating systems and since the script would be interpreted it could still work as a template that relx could use with overlays.
I'm not sure how this would play together with start script extensions, but I'm sure there's a way to solve that too.
@bajankristof interesting idea but it would still require a good bit of OS specific code in it I think. And I'm not sure what launching the release would look like. Like if running os:cmd
doesn't result in the process being killed when the escript exits.
Yeah, that's a good point.
Maybe instead of running os:cmd
, the escript could return the command that should be executed to the calling os specific script. This shouldn't be a major problem since that command is the last one executed by the start script anyway.
I'm just thinking out loud here though 🙂