Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-55053

Jenkins init script does not stop jenkins if JENKINS_HOME not found

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • packaging
    • Centos7
    • 2.335

      Hello, I run into an issue with the jenkins.init script : it does not stop jenkins process if JENKINS_HOME does not exist and it returns 0 like everything was fine.

      In my case /var/lib/jenkins is stored on a NAS, if I start jenkins and then unmount /var/lib/jenkins, jenkins.init stop will not stop jenkins.

      It's a problem if you use failover system like corosync to start another jenkins instance in case of failure because the script returns 0 and corosync will assume that jenkins is stopped.

      As you can see below, this behavior happens only when you try to stop jenkins, others commands will return 1.

      [ -d "$JENKINS_HOME" ] || { echo "JENKINS_HOME directory does not exist: $JENKINS_HOME"; if [ "$1" = "stop" ]; then exit 0; else exit 1; fi; }
      

            basil Basil Crow
            jl_35 Jeremy L
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: