Start Jenkins command starts but does not return back to shell on centos

Service fails at the start up.

jenkins.service - LSB: Jenkins Automation Server
   Loaded: loaded (/etc/rc.d/init.d/jenkins; static; vendor preset: disabled)
   Active: failed (Result: timeout) since Fri 2022-04-22 00:31:07 PDT; 1 day 18h ago
     Docs: man:systemd-sysv-generator(8)
  Process: 21720 ExecStart=/etc/rc.d/init.d/jenkins start (code=killed, signal=TERM)
   CGroup: /system.slice/jenkins.service
           ├─21725 runuser -s /bin/bash jenkins -c ulimit -S -c 0 >/dev/null 2>&1 ; /etc/alternatives/java -Djava.awt.headless=true -Dprocess.label=jenkins -Dhudson.model.DirectoryBrowserSupport.CSP="" -Xmx8192m -DJENKINS_HOME=/var/lib...
           ├─21726 bash -c ulimit -S -c 0 >/dev/null 2>&1 ; /etc/alternatives/java -Djava.awt.headless=true -Dprocess.label=jenkins -Dhudson.model.DirectoryBrowserSupport.CSP="" -Xmx8192m -DJENKINS_HOME=/var/lib/jenkins -jar /usr/lib/j...
           └─21727 /etc/alternatives/java -Djava.awt.headless=true -Dprocess.label=jenkins -Dhudson.model.DirectoryBrowserSupport.CSP= -Xmx8192m -DJENKINS_HOME=/var/lib/jenkins -jar /usr/lib/jenkins/jenkins.war --logfile=/var/log/jenki...

Apr 22 00:26:07 ip-192-168-0-164.ec2.internal systemd[1]: Starting LSB: Jenkins Automation Server...
Apr 22 00:26:07 ip-192-168-0-164.ec2.internal runuser[21725]: pam_unix(runuser:session): session opened for user jenkins by (uid=0)
Apr 22 00:31:07 ip-192-168-0-164.ec2.internal systemd[1]: jenkins.service start operation timed out. Terminating.
Apr 22 00:31:07 ip-192-168-0-164.ec2.internal systemd[1]: Failed to start LSB: Jenkins Automation Server.
Apr 22 00:31:07 ip-192-168-0-164.ec2.internal systemd[1]: Unit jenkins.service entered failed state.
Apr 22 00:31:07 ip-192-168-0-164.ec2.internal systemd[1]: jenkins.service failed.

But jenkins are running successfully as a process.

root 21725 0.0 0.0 144312 1544 ? S Apr22 0:00 runuser -s /bin/bash **jenkins** -c ulimit -S -c 0 >/dev/null 2>&1 ; /etc/alternatives/java -Djava.awt.headless=true -Dprocess.label= **jenkins** -Dhudson.model.DirectoryBrowserSupport.CSP="" -Xmx8192m -DJENKINS_HOME=/var/lib/ **jenkins** -jar /usr/lib/ **jenkins** / **jenkins** .war --logfile=/var/log/ **jenkins** / **jenkins** .log --webroot=/var/cache/ **jenkins** /war --daemon --httpPort=8080 --debug=5 --handlerCountMax=100 --handlerCountMaxIdle=20

**jenkins** 21726 0.0 0.0 113172 1404 ? Ss Apr22 0:00 bash -c ulimit -S -c 0 >/dev/null 2>&1 ; /etc/alternatives/java -Djava.awt.headless=true -Dprocess.label= **jenkins** -Dhudson.model.DirectoryBrowserSupport.CSP="" -Xmx8192m -DJENKINS_HOME=/var/lib/ **jenkins** -jar /usr/lib/ **jenkins** / **jenkins** .war --logfile=/var/log/ **jenkins** / **jenkins** .log --webroot=/var/cache/ **jenkins** /war --daemon --httpPort=8080 --debug=5 --handlerCountMax=100 --handlerCountMaxIdle=20

**jenkins** 21727 1.1 28.4 14772868 9330840 ? Sl Apr22 29:58 /etc/alternatives/java -Djava.awt.headless=true -Dprocess.label= **jenkins** -Dhudson.model.DirectoryBrowserSupport.CSP= -Xmx8192m -DJENKINS_HOME=/var/lib/ **jenkins** -jar /usr/lib/ **jenkins** / **jenkins** .war --logfile=/var/log/ **jenkins** / **jenkins** .log --webroot=/var/cache/ **jenkins** /war --daemon --httpPort=8080 --debug=5 --handlerCountMax=100 --handlerCountMaxIdle=20

That line indicates that you’re either running a version of Jenkins before the transition from System V init to systemd or you did not upgrade by using the yum package.

When a package is installed with an operating system package manager, it should be upgraded with the operating system package manager. If you instead just replace the war file with a newer version, you’ve missed the upgrade logic that made the transition from System V init to systemd.

Please use the command

# yum upgrade jenkins

More details are available in the blog post.

Additional information is available in the Jenkins 2.332.1 upgrade guide.

1 Like

this thread also has more details.

2 Likes