Installing jenkins, lab: install jenkins on a vm

I am following this instruction on centos in lab to install jenkins and also updating port but i am getting some issue or unable to start jenkin service

sudo yum install epel-release -y
sudo yum install java -y
sudo wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo --no-check-certificate
sudo rpm --import http://pkg.jenkins.io/redhat-stable/jenkins.io.key
sudo yum install jenkins -y

I am getting error upon starting the service
Job for jenkins.service failed because the control process exited with error code. See “systemctl status jenkins.service” and “journalctl -xe” for details.

Please reply.

Can you share the output of systemctl status jenkins.service ?

This definitely does not work with the official instructions in the lab environment. I was able to get past the issue by installing the Jenkins Docker container.

Output of systemctl start jenkins is below

Mar 12 18:11:01 centos-host systemd[1]: jenkins.service: main process exited, code=exited, status=1/FAILURE
Mar 12 18:11:01 centos-host systemd[1]: Failed to start Jenkins Continuous Integration Server.
-- Subject: Unit jenkins.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit jenkins.service has failed.
-- 
-- The result is failed.
Mar 12 18:11:01 centos-host systemd[1]: Unit jenkins.service entered failed state.
Mar 12 18:11:01 centos-host systemd[1]: jenkins.service failed.
Mar 12 18:11:02 centos-host systemd[1]: jenkins.service holdoff time over, scheduling restart.
Mar 12 18:11:02 centos-host systemd[1]: Stopped Jenkins Continuous Integration Server.
-- Subject: Unit jenkins.service has finished shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit jenkins.service has finished shutting down.
Mar 12 18:11:02 centos-host systemd[1]: Starting Jenkins Continuous Integration Server...
-- Subject: Unit jenkins.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit jenkins.service has begun starting up.
Mar 12 18:11:02 centos-host systemd[1]: systemd-journald.service: Couldn't add fd to fd store: Operation not permitted
Mar 12 18:11:02 centos-host jenkins[3257]: Running from: /usr/share/java/jenkins.war
Mar 12 18:11:02 centos-host jenkins[3257]: 2022-03-12 18:11:02.539+0000 [id=1]        INFO        org.eclipse.jetty.util.log.Log#initialized: Logging initialized @385ms to org.eclipse.jetty.util.log.JavaUtilLog

I have the same issue. Tried yesterday, tried today. So far I haven’t been able to solve the problem.

Hello, @kishlay-raj
Thanks for sharing an error screenshot. One of our team members is working on it.
Please be patience.

Regards,

@kishlay-raj
In case, If you wanna troubleshoot and fix this issue please follow the below instructions -

sudo journalctl -xe -u jenkins

You will see the error that it’s happening due to a failed to bind port.

sudo systemctl status jenkins

you will see the unit file of this jenkins.

sudo vi /usr/lib/systemd/system/jenkins.service

change the JENKINS_PORT=“8080” to “8090”
then reload the daemon because we made some changes in the unit files and then restart the jenkins service.

sudo systemctl daemon-reload

sudo systemctl restart jenkins

sudo systemctl status jenkins

after that it’s good to go to explore Jenkins UI.

1 Like

Hello Tej_Singh_Rana

I am struggling with the same error message, I have changed the PORT to 8090 but still getting same error message on Jenkins installation.


– Unit jenkins.service has begun starting up.
Jun 12 20:37:21 centos-host systemd[1]: jenkins.service: main process exited, code=exited, status=1/FAILURE
Jun 12 20:37:21 centos-host systemd[1]: Failed to start Jenkins Continuous Integration Server.
– Subject: Unit jenkins.service has failed
– Defined-By: systemd
– Support: systemd-devel Info Page

– Unit jenkins.service has failed.


[bob@centos-host packages]$ sudo cat /usr/lib/systemd/system/jenkins.service | grep -i Jenkins_port
Environment=“JENKINS_PORT=8090”
[bob@centos-host packages]$ sudo systemctl start jenkins
Job for jenkins.service failed because the control process exited with error code. See “systemctl status jenkins.service” and “journalctl -xe” for details.
[bob@centos-host packages]$

that’s odd. Let me check and get back to you.

I checked the lab and didn’t see any issues.

Please give it another try and let me know how’s it going this time.

Regards,

Thanks it works for me.

I have tried the same steps told by you… but same error
● jenkins.service - Jenkins Continuous Integration Server
Loaded: loaded (/usr/lib/systemd/system/jenkins.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Thu 2023-08-24 00:27:41 UTC; 13s ago
Process: 8376 ExecStart=/usr/bin/jenkins (code=exited, status=1/FAILURE)
Main PID: 8376 (code=exited, status=1/FAILURE)

Aug 24 00:27:41 jenkins.stratos.xfusioncorp.com systemd[1]: jenkins.service: Service RestartSec=100ms expired, scheduling restart.
Aug 24 00:27:41 jenkins.stratos.xfusioncorp.com systemd[1]: jenkins.service: Scheduled restart job, restart counter is at 5.
Aug 24 00:27:41 jenkins.stratos.xfusioncorp.com systemd[1]: Stopped Jenkins Continuous Integration Server.
Aug 24 00:27:41 jenkins.stratos.xfusioncorp.com systemd[1]: jenkins.service: Start request repeated too quickly.
Aug 24 00:27:41 jenkins.stratos.xfusioncorp.com systemd[1]: jenkins.service: Failed with result ‘exit-code’.
Aug 24 00:27:41 jenkins.stratos.xfusioncorp.com systemd[1]: Failed to start Jenkins Continuous Integration Server.
Aug 24 00:27:43 jenkins.stratos.xfusioncorp.com systemd[1]: jenkins.service: Start request repeated too quickly.
Aug 24 00:27:43 jenkins.stratos.xfusioncorp.com systemd[1]: jenkins.service: Failed with result ‘exit-code’.
Aug 24 00:27:43 jenkins.stratos.xfusioncorp.com systemd[1]: Failed to start Jenkins Continuous Integration Server.

hello,
i have the same error , i change the port and i restart jenkins but i still getting this error.
Any solution?

1 Like

Ok, found the issue. Instead of editing /usr/lib/systemd/system/jenkins.service edit /lib/systemd/system/jenkins.service. And it should work fine.

I’m also getting same error, I couldnt start the service after changed port no.

Please don’t post the same message or question in multiple threads.

I apologize, I’ve now shared the logs in an other post.
Kindly check .