Jenkins Jenkins Administration 1 — Questions and Answers
Question 1: Where does Jenkins store its configuration, jobs, and plugins by default on a Linux system?
- /var/lib/jenkins (Correct answer)
- /etc/jenkins
- /opt/jenkins/data
- /home/jenkins/.jenkins
Correct answer: /var/lib/jenkins
The default Jenkins home directory on Linux is `/var/lib/jenkins`, controlled by the `JENKINS_HOME` environment variable.
Question 2: What is the recommended way to apply Jenkins system configuration as code rather than through the UI?
- Jenkins Configuration as Code (JCasC) Plugin (Correct answer)
- Groovy Init Scripts
- Jenkins CLI
- Ansible Playbooks
Correct answer: Jenkins Configuration as Code (JCasC) Plugin
The Jenkins Configuration as Code (JCasC) plugin allows the entire Jenkins system configuration to be defined in a YAML file.
Question 3: Which file in JENKINS_HOME contains the main Jenkins system configuration?
- config.xml (Correct answer)
- jenkins.xml
- system.xml
- settings.xml
Correct answer: config.xml
The `config.xml` file at the root of `JENKINS_HOME` stores the primary Jenkins system configuration in XML format.
Question 4: How do you safely restart Jenkins without losing queued builds?
- Use /safeRestart endpoint or Manage Jenkins > Reload Configuration (Correct answer)
- Restart the OS
- Kill the Jenkins process
- Use /restart endpoint immediately
Correct answer: Use /safeRestart endpoint or Manage Jenkins > Reload Configuration
The `/safeRestart` URL waits for all running builds to finish before restarting Jenkins, preventing build loss.
Question 5: What is the purpose of the Jenkins CLI tool (`jenkins-cli.jar`)?
- Perform administrative tasks via command line without a browser (Correct answer)
- Deploy Jenkins to servers
- Build and compile Jenkins plugins
- Monitor Jenkins agent health
Correct answer: Perform administrative tasks via command line without a browser
The Jenkins CLI jar allows administrators to trigger builds, manage jobs, and run Groovy scripts from the command line.
Question 6: What is the default port Jenkins listens on when installed from the official package?
- 8080 (Correct answer)
- 8443
- 9090
- 3000
Correct answer: 8080
Jenkins defaults to port 8080 for HTTP; this can be changed via the `--httpPort` argument or the configuration file.
Where does Jenkins store its configuration, jobs, and plugins by default on a Linux system?