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

Jenkins is starting multiple process when running

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Blocker
    • Resolution: Not A Defect
    • other
    • None

    Description

      I am trying to upgrade jenkins from 2.231 version 2.319.3. I could see after replacing jenkins.war, when trying to run the jenkins using "sudo systemctl start jenkins" command, command is not returning and getting hung. I could see that it is starting jenkins but 3 jenkins processes are getting started.

      Attachments

        Activity

          mawinter69 Markus Winter added a comment -

          In your picture you have a process tree:
          The first command is runuser
          the second is a /bin/bash
          the third is the actual java
          As you use systemd to start Jenkins did you look at the blog-post about the systemd migration https://www.jenkins.io/blog/2022/03/25/systemd-migration/
          Or have you written your own systemd start config?

          mawinter69 Markus Winter added a comment - In your picture you have a process tree: The first command is runuser the second is a /bin/bash the third is the actual java As you use systemd to start Jenkins did you look at the blog-post about the systemd migration https://www.jenkins.io/blog/2022/03/25/systemd-migration/ Or have you written your own systemd start config?
          markewaite Mark Waite added a comment - - edited

          See https://community.jenkins.io/t/changes-in-etc-sysconfig-not-being-applied/2717/3 for more links related to systemd transition. First step, if you installed originally with the operating system package manager, be sure that you perform the upgrade with the operating system package manager. Don't upgrade by replacing jenkins.war. That's not the way to do it.

          markewaite Mark Waite added a comment - - edited See https://community.jenkins.io/t/changes-in-etc-sysconfig-not-being-applied/2717/3 for more links related to systemd transition. First step, if you installed originally with the operating system package manager, be sure that you perform the upgrade with the operating system package manager. Don't upgrade by replacing jenkins.war. That's not the way to do it.
          nprabhu Nikhil Prabhu added a comment -

          markewaite/mawinter69

          I am not using any custom startup file and I dont see jenkins is installed using operating system manager.

          What I can understand from above links is that, systemd migration is needed for package manager installation only and also for the version 2.332.1 and above

           

          I see one jenkins file under /etc/init.d directory and dont see any files under systemd.

          Apologies If I am missing something and not able to understand what you have mentioned above

          nprabhu Nikhil Prabhu added a comment - markewaite / mawinter69 ,  I am not using any custom startup file and I dont see jenkins is installed using operating system manager. What I can understand from above links is that, systemd migration is needed for package manager installation only and also for the version 2.332.1 and above   I see one jenkins file under /etc/init.d directory and dont see any files under systemd. Apologies If I am missing something and not able to understand what you have mentioned above
          markewaite Mark Waite added a comment -

          You did not mention the operating system where you are running Jenkins. Are you sure that you used the operating system package manager to check for the jenkins package installed with the package manager? A file /etc/init.d/jenkins without an operating system package manager means that someone created a Jenkins service themselves rather than use the service provided by the operating system package manager.

          If there truly is not a jenkins package for an operating system package manager on that system, then you are left with two choices:

          • Identify the service and packaging differences between the Jenkins version before and after and extend / modify your systemd unit definition to support the new Jenkins version
          • Replace the existing jenkins service with a service created by installing the operating system package

          In either of those cases, I suspect you will need to make significant changes to your environment. Create multiple backups before doing that. Verify the backups are in good condition.

          If you choose the first option, you choose to continue maintaining your private systemd service definition. That means you choose to follow changes to Jenkins core related to packaging and update your private systemd service definition to keep pace with those changes. You choose to continue to support your system as a "one of a kind" installation with a private systemd service definition.

          If you choose the second option, you choose to stop and remove your existing private systemd or System V init service definition. There may be expectations in your installation of things that were defined in your private service definition that you will need to replicate in the service definition created by the operating system package provided by the Jenkins project.

          markewaite Mark Waite added a comment - You did not mention the operating system where you are running Jenkins. Are you sure that you used the operating system package manager to check for the jenkins package installed with the package manager? A file /etc/init.d/jenkins without an operating system package manager means that someone created a Jenkins service themselves rather than use the service provided by the operating system package manager. If there truly is not a jenkins package for an operating system package manager on that system, then you are left with two choices: Identify the service and packaging differences between the Jenkins version before and after and extend / modify your systemd unit definition to support the new Jenkins version Replace the existing jenkins service with a service created by installing the operating system package In either of those cases, I suspect you will need to make significant changes to your environment. Create multiple backups before doing that. Verify the backups are in good condition. If you choose the first option, you choose to continue maintaining your private systemd service definition. That means you choose to follow changes to Jenkins core related to packaging and update your private systemd service definition to keep pace with those changes. You choose to continue to support your system as a "one of a kind" installation with a private systemd service definition. If you choose the second option, you choose to stop and remove your existing private systemd or System V init service definition. There may be expectations in your installation of things that were defined in your private service definition that you will need to replicate in the service definition created by the operating system package provided by the Jenkins project.
          nprabhu Nikhil Prabhu added a comment -

          markewaite ,

          jenkins is running on Amazon Linux 2 OS which is built on top REDHAT I believe.

          I dont see any file under /etc/yum.repos.d so I am assuming it is not installed through yum command.

          Also when I run "rpm -q jenkins" it is giving "package jenkins is not installed"

          Is there a way I can check how this is installed in first place?

          Also incase if its installed using rpm, how can we update using rpm? Do we have any support doc available for that?

          nprabhu Nikhil Prabhu added a comment - markewaite , jenkins is running on Amazon Linux 2 OS which is built on top REDHAT I believe. I dont see any file under /etc/yum.repos.d so I am assuming it is not installed through yum command. Also when I run "rpm -q jenkins" it is giving "package jenkins is not installed" Is there a way I can check how this is installed in first place? Also incase if its installed using rpm, how can we update using rpm? Do we have any support doc available for that?
          markewaite Mark Waite added a comment -

          Since rpm -q jenkins reports the package is not installed, you must have a locally created systemd unit or System V init based service configuration. The options are as described in my previous comment:

          • Adapt your private systemd service definition to match what Jenkins expects
          • Switch from your private systemd service definition to use the Jenkins rpm package

          Is there a way I can check how this is installed in first place?

          Not really, unless you have something like etckeeper that is tracking changes to your local service definitions. Since it was not installed with the package manager, there is no package manager history for the installation.

          how can we update using rpm? Do we have any support doc available for that?

          When installed with the package manager, the upgrade process is usually as simple as (RHEL 7):

          yum update jenkins

          or (RHEL 8, Fedora, others)

          dnf update jenkins

          or (Debian, Ubuntu)

          apt-get upgrade jenkins

          markewaite Mark Waite added a comment - Since rpm -q jenkins reports the package is not installed, you must have a locally created systemd unit or System V init based service configuration. The options are as described in my previous comment: Adapt your private systemd service definition to match what Jenkins expects Switch from your private systemd service definition to use the Jenkins rpm package Is there a way I can check how this is installed in first place? Not really, unless you have something like etckeeper that is tracking changes to your local service definitions. Since it was not installed with the package manager, there is no package manager history for the installation. how can we update using rpm? Do we have any support doc available for that? When installed with the package manager, the upgrade process is usually as simple as (RHEL 7): yum update jenkins or (RHEL 8, Fedora, others) dnf update jenkins or (Debian, Ubuntu) apt-get upgrade jenkins

          People

            Unassigned Unassigned
            nprabhu Nikhil Prabhu
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: