Interview Prep/Jenkins/Architecture, executors & JENKINS_HOME

What is the agent work directory and why does `-workDir` matter?

BeginnerConceptArchitecture, executors & JENKINS_HOME
Answer

-workDir tells agent.jar where to keep its remoting cache, logs (remoting/logs) and workspaces. Without it, remoting uses the current directory and writes logs to stderr, making connection problems hard to debug and jar caches end up in the user's home. Always set it, for example -workDir /home/jenkins/agent, and put it on a disk with enough space for workspaces.

All Jenkins questions Roadmap: Jenkins

More on Architecture, executors & JENKINS_HOME