lookup('env', 'PWD')
returns an empty string when deploying TDP via TDP-server running as a Linux service
#781
Labels
bug
Something isn't working
Error
A deployment via TDP-server or TDP-ui, when TDP-server running as a Linux service, craches with the error like:
Cause
The base path to binaries files is defined in the variable
binaries_local_dir: "{{ lookup('env', 'PWD') }}/files"
. This works fine when launching a deployment via TDP-lib (tdp deploy
) or via TDP-server (or TDP-ui) when tdp-server is started as a process in terminal.However, it doesn't work when TDP-server is started as a Linux service, because
{{ lookup('env', 'PWD') }}
returns an empty string. This because PWD is a shell variable, in the sense its maintained by the shell.in the systemd unit there is no shell hence the issue
To reproduce
Install TDP-server while installing TDP-getting-started
Configure TDP-server as a Linux service (configuring
tdp-server.service
file)Example
/etc/systemd/system/tdp-server.service
fileExample
/etc/sysconfig/tdp-server
file:Start TDP-server service with
systemctl start tdp-service
Run deployment with the command like:
Workaround
There are multiple choices:
PWD
equals the root folder of yourfiles
folder with binaries.Exemple
/etc/sysconfig/tdp-server
:binaries_local_dir
variable with smth withoutlookup
, for example:Solution
Define
binaries_local_dir
differently without using PWD.The text was updated successfully, but these errors were encountered: