# Jenkins upgrade Issue in Centos 7 INC

**URL:** <https://community.jenkins.io/t/jenkins-upgrade-issue-in-centos-7-inc/3884>\
**Category:** Ask a question\
**Created:** [September 21, 2022, 7:45pm UTC](https://community.jenkins.io/t/jenkins-upgrade-issue-in-centos-7-inc/3884 "2022-09-21T19:45:34Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![sandeepkumarsingh](https://avatars.discourse-cdn.com/v4/letter/s/958977/32.png) [@sandeepkumarsingh](https://community.jenkins.io/u/sandeepkumarsingh)\
**Post date:** [September 21, 2022, 7:45pm UTC](https://community.jenkins.io/t/jenkins-upgrade-issue-in-centos-7-inc/3884/1 "2022-09-21T19:45:34Z")

</div>

I have recently upgraded Jenkins from 2.164.0 to 11.0.16 version and Java open Jdk 11.0.16  
But facing issue when restarting, can you help us to find the cause and fix it.

[root@ip-172-31-91-129 ~]# sudo systemctl status jenkins  
● jenkins.service - LSB: Jenkins Automation Server  
Loaded: loaded (/etc/rc.d/init.d/jenkins; bad; vendor preset: disabled)  
Active: failed (Result: exit-code) since Wed 2022-09-21 14:51:36 EDT; 31min ago  
Docs: man:systemd-sysv-generator(8)  
Process: 14646 ExecStart=/etc/rc.d/init.d/jenkins start (code=exited, status=1/FAILURE)  
Memory: 542.6M  
CGroup: /system.slice/jenkins.service  
├─22694 runuser -s /bin/bash centos -c ulimit -S -c 0 \>/dev/null 2\>&1 ; /etc/alternatives/java -Djava.awt.headless=true -DJENKI…  
├─22695 bash -c ulimit -S -c 0 \>/dev/null 2\>&1 ; /etc/alternatives/java -Djava.awt.headless=true -DJENKINS\_HOME=/home/centos/je…  
└─22696 /etc/alternatives/java -Djava.awt.headless=true -DJENKINS\_HOME=/home/centos/jenkins\_home -jar /usr/lib/jenkins/jenkins…

Sep 21 14:51:35 ip-172-31-91-129.ec2.internal systemd[1]: Starting LSB: Jenkins Automation Server…  
Sep 21 14:51:35 ip-172-31-91-129.ec2.internal runuser[14651]: pam\_unix(runuser:session): session opened for user centos by (uid=0)  
Sep 21 14:51:36 ip-172-31-91-129.ec2.internal jenkins[14646]: Starting Jenkins [FAILED]  
Sep 21 14:51:36 ip-172-31-91-129.ec2.internal systemd[1]: jenkins.service: control process exited, code=exited status=1  
Sep 21 14:51:36 ip-172-31-91-129.ec2.internal systemd[1]: Failed to start LSB: Jenkins Automation Server.  
Sep 21 14:51:36 ip-172-31-91-129.ec2.internal systemd[1]: Unit jenkins.service entered failed state.  
Sep 21 14:51:36 ip-172-31-91-129.ec2.internal systemd[1]: jenkins.service failed.

---

<div class="post-metadata">

**Author:** ![MarkEWaite](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/markewaite/32/20_2.png) [@MarkEWaite](https://community.jenkins.io/u/MarkEWaite)\
**Post date:** [September 21, 2022, 8:07pm UTC](https://community.jenkins.io/t/jenkins-upgrade-issue-in-centos-7-inc/3884/2 "2022-09-21T20:07:23Z")

</div>

> [@Version upgrade - Jenkins service getting failed but the application is running fine](https://community.jenkins.io/t/version-upgrade-jenkins-service-getting-failed-but-the-application-is-running-fine/3766/2):
>
> tl;dr don’t upgrade war if you are using system packages, update system packages Hi there, Jenkins 2.332.1 switched Jenkins from using System V init to use systemd with its Linux package installers for Debian, Ubuntu, Red Hat, Alma, openSUSE, Rocky, and more. The [LTS Upgrade Guide](https://www.jenkins.io/doc/upgrade-guide/2.332/#upgrading-to-jenkins-lts-2-332-1) describes that transition and how to adapt your environment to the transition. There is a [blog post](https://www.jenkins.io/blog/2022/03/25/systemd-migration/) about it as well at There is also a [video introduction](https://www.youtube.com/watch?v=MkokjTQ2ngc) for RPM based distributions like Red Hat Enterprise L…

---

<div class="post-metadata">

**Author:** ![Ian\_W](https://avatars.discourse-cdn.com/v4/letter/i/cab0a1/32.png) [@Ian\_W](https://community.jenkins.io/u/Ian_W)\
**Post date:** [September 22, 2022, 3:21am UTC](https://community.jenkins.io/t/jenkins-upgrade-issue-in-centos-7-inc/3884/3 "2022-09-22T03:21:11Z")

</div>

It seems this topic has come up quite often recently, both here, google groups, gitter, and S/O.

Thinking out loud (as I don’t have it installed via package), is there a way Jenkins can know it has been installed via package manager, then based on that either disable the upgrade automatically button and/or throw up a warning, “_It appears Jenkins was installed via a package manager. We recommend you update via the package manager rather than the UI or direct war replacement_.” ?

In a perfect world, clicking upgrade in the UI would trigger the package manager to perform a package update and restart the service, but that is probably impractical, unrealistic and potentially consequential.

At least throwing up warning, guiding them to the best practice, or disabling, plus guidance could go a long way to reducing the support load.

---

<div class="post-metadata">

**Author:** ![halkeye](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/halkeye/32/8_2.png) [@halkeye](https://community.jenkins.io/u/halkeye)\
**Post date:** [September 22, 2022, 5:45am UTC](https://community.jenkins.io/t/jenkins-upgrade-issue-in-centos-7-inc/3884/4 "2022-09-22T05:45:10Z")

</div>

I’m sure it’s doable with effort. You could query apt or rpm databases on startup and write a monitor. But it’s kinda too late for that. You want to display the warning before they do the upgrade, but you need the upgrade to get the warning. Potentially could check to see if the version running is the same as the package installed and spit out something to the startup log. I’m not sure anyone would want to spend the dev effort though. People tend to spend effort in areas that affect them

I’m pretty sure the problem isn’t people clicking upgrade in the UI. I’m pretty sure that’s only available if you can overwrite the war file, and I think the default packages all run as non root.

The problem so far is that people manually download new versions using curl/wget and override the war. We even had people doing this inside of docker images.

I’m not sure where these suggestions are coming from, but I should guess probably back in the days when releases were really unstable.

---

<div class="post-metadata">

**Author:** ![sandeepkumarsingh](https://avatars.discourse-cdn.com/v4/letter/s/958977/32.png) [@sandeepkumarsingh](https://community.jenkins.io/u/sandeepkumarsingh)\
**Post date:** [September 27, 2022, 4:54pm UTC](https://community.jenkins.io/t/jenkins-upgrade-issue-in-centos-7-inc/3884/5 "2022-09-27T16:54:07Z")

</div>

Thanks for Quick Respond !  
The steps has followed to upgraded the version.

1. Downloaded latest version 2.361.1 LTS
2. Kept at path where existing was presented.
3. Rename old one as a backup.
4. Install open jdk 11.0 which was recommended for Latest Jenkins version.
5. Pointed to Latest Java open Jdk 11.
6. Java open jdk and Jenkins GUI lavel are upgraded.
7. all above has done with stop the jenkins
8. While restarting the Jenkins getting an issue.  
#sudo systemctl restart jenkins  
Error:  
[centos@ip-172-31-91-129 ~]$ sudo systemctl status jenkins  
● jenkins.service - LSB: Jenkins Automation Server  
Loaded: loaded (/etc/rc.d/init.d/jenkins; bad; vendor preset: disabled)  
Active: failed (Result: exit-code) since Mon 2022-09-26 02:10:08 EDT; 1 day 8h ago  
Docs: man:systemd-sysv-generator(8)  
Process: 9868 ExecStart=/etc/rc.d/init.d/jenkins start (code=exited, status=1/FAILURE)

=================================================

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/jenkins/original/2X/0/0eb92f303b441b3622a65afaa10c897de7d2a32c.jpeg)

---

<div class="post-metadata">

**Author:** ![MarkEWaite](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/markewaite/32/20_2.png) [@MarkEWaite](https://community.jenkins.io/u/MarkEWaite)\
**Post date:** [September 27, 2022, 5:25pm UTC](https://community.jenkins.io/t/jenkins-upgrade-issue-in-centos-7-inc/3884/6 "2022-09-27T17:25:47Z")

</div>

> [@sandeepkumarsingh](#):
>
> #sudo systemctl restart jenkins  
> Error:  
> [centos@ip-172-31-91-129 ~]$ sudo systemctl status jenkins  
> ● jenkins.service - LSB: Jenkins Automation Server  
> Loaded: loaded (/etc/rc.d/init.d/jenkins; bad; vendor preset: disabled)

That message says that you are running a **new** Jenkins war file but using the service management system that was provided by an **old** Jenkins RPM installer. That usually means the upgrade was performed incorrectly.

When Jenkins is installed with rpm (or apt), it needs to be upgraded with rpm (or apt). Do not upgrade Jenkins by replacing the war file. That bypasses the rpm (or apt) upgrade process.

```bash
# yum upgrade jenkins

```

Details are included in the answer that was linked earlier in this thread

> [@Version upgrade - Jenkins service getting failed but the application is running fine](https://community.jenkins.io/t/version-upgrade-jenkins-service-getting-failed-but-the-application-is-running-fine/3766/2):
>
> tl;dr don’t upgrade war if you are using system packages, update system packages Hi there, Jenkins 2.332.1 switched Jenkins from using System V init to use systemd with its Linux package installers for Debian, Ubuntu, Red Hat, Alma, openSUSE, Rocky, and more. The [LTS Upgrade Guide](https://www.jenkins.io/doc/upgrade-guide/2.332/#upgrading-to-jenkins-lts-2-332-1) describes that transition and how to adapt your environment to the transition. There is a [blog post](https://www.jenkins.io/blog/2022/03/25/systemd-migration/) about it as well at There is also a [video introduction](https://www.youtube.com/watch?v=MkokjTQ2ngc) for RPM based distributions like Red Hat Enterprise L…
