docker-systemctl-replacement icon indicating copy to clipboard operation
docker-systemctl-replacement copied to clipboard

allow extra pre-start scripts outside of the *.service

Open gdraheim opened this issue 7 years ago • 1 comments

There is an obversation with some kubernetes (/rancher/openshift) setups where a docker-entrypoint.sh script is being used that pulls (!) settings from the runtime environment before doing the final exec $start command. In a way that is related to the ExecStartPre statements in a *.service but with the idea that the pre-script may set (or override) some env-variables for the start-proc of the actual service jar. Of course these scripts do not have a meaningful outcome in a situation outside of a specific target environment, so they will probably not be encoded in the *.service script itself. So it would be best to have a systemctl.py feature that supports additional Env-Scripts - which is a new feature over Env-Settings, Env-Files, and one should be able to extend an existing service outside of the *.service just like it is already common with *.wants and *.preset directories.

gdraheim avatar Apr 22 '18 07:04 gdraheim

Remember that an service script can have a service.d where the lines can be mixin to the base service descriptor. That way one can actually add ExecStartPre.

Atleast make a test case that shows this behaviour in relation to external shell variables to come in. Unlike a real systemd daemon, the environment variables do work on service-start.

gdraheim avatar Jul 21 '18 09:07 gdraheim