generic-worker icon indicating copy to clipboard operation
generic-worker copied to clipboard

When running with runTasksAsCurrentUser, no way to know the task directory

Open glandium opened this issue 7 years ago • 3 comments

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.

glandium avatar Jul 21 '18 00:07 glandium

Mmmm the code in process/process_all-unix-style.go says it should be the working directory...

glandium avatar Jul 21 '18 00:07 glandium

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.

glandium avatar Jul 21 '18 01:07 glandium

Thanks for raising! I'll take a look.

petemoore avatar Aug 01 '18 10:08 petemoore