generic-worker
generic-worker copied to clipboard
When running with runTasksAsCurrentUser, no way to know the task directory
A task directory is created when a task starts, but, when runTasksAsCurrentUser is set:
- the task isn't run with the task directory as its current directory
- there is no environment variable containing the task directory location
So it's essentially impossible to make use of the task directory in that case.
Mmmm the code in process/process_all-unix-style.go says it should be the working directory...
So, the problem is that the PWD environment variable in the task is whatever the working directory was when the worker was started. The pwd command returns the right path, but the environment is kind of lying.
Thanks for raising! I'll take a look.