Jenkins not starting on CentOS 7 / RHEL 7

Jenkins not starting on CentOS 7 / RHEL 7

Today i was installing Jenkins on a CentOS7 systems. After installing it via Jenkins yum repository, the service was not stating. The java was already installed on the server.

Issue

  • You have installed jenkins on a CentOS7 / RHEL7 system.
  • jenkins is not starting via systemctl start jenkins command, and it is throwing journalctl -xn error.
    Caused by: java.lang.UnsatisfiedLinkError: /tmp/jna--1712433994/jna6368781091883887102.tmp: /tmp/jna--1712433994/jna6368781091883887102.tmp: failed to map segment from shared object: Operation not permitted

Solution

  • Makes sure you have installed java and verify the version.
    # java -version
    openjdk version "1.8.0_121"
    OpenJDK Runtime Environment (build 1.8.0_121-b13)
    OpenJDK 64-Bit Server VM (build 25.121-b13, mixed mode)
  • edit /etc/sysconfig/jenkins , and change the below line,

    Line number 48, change

    ENKINS_JAVA_OPTIONS="-Djava.awt.headless=true"

    to
    JENKINS_JAVA_OPTIONS="-Djava.awt.headless=true -Djna.tmpdir=/var/lib/jenkins/tmp"
  • Now you will be able to stop and start the jenkins service without any error.
    systemctl stop jenkins
    systemctl start jenkins

4 thoughts on “Jenkins not starting on CentOS 7 / RHEL 7”

  • 1
    beto on May 9, 2018 Reply

    Thank you so much fore sharing it!
    Fixed my problem.

  • 3
    Nelson on May 22, 2018 Reply

    Resolveu na raiz! muito obrigado

Leave a Reply

Your email address will not be published. Required fields are marked *