I am trying out systemd script along in Docker environment.
Consider this:
command mentioned in ExecStartPre updating environment file and ExecStart actually making use of environment variable mentioned in env. file.? (all in the same systemd file).
like this:
[Unit]
Description=test service
Before=memcached.service
[Service]
Type=oneshot
EnvironmentFile=-/etc/sysconfig/testfile
ExecStartPre=/usr/local/bin/update_sysconfig_testfile.sh
ExecStart=/usr/bin/testmebinary $VOLUMES
[Install]
WantedBy=multi-user.target
Here, $VOLUMES is defined inside testfile and it is updated by update_sysconfig_testfile.sh script.
Will systemd aware about the change made by ExecStartPre (or) it just loads whatever value in testfile?
If there is any better approach, please share.