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.
More on Architecture, executors & JENKINS_HOME
What are the main components of a Jenkins installation?BeginnerWhat is the difference between a node, an agent and an executor?BeginnerWhy should the built-in node have 0 executors?BeginnerWhat is `JENKINS_HOME` and what are its most important contents?BeginnerWhat happens if you lose the `secrets/` directory but keep `credentials.xml`?AdvancedHow does an agent communicate with the controller?Intermediate