mirror of
https://github.com/konstruktoid/hardening.git
synced 2026-04-26 01:05:56 +03:00
[GH-ISSUE #23] Jenkins service is not able to start up #8
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @joharkwan on GitHub (Apr 5, 2018).
Original GitHub issue: https://github.com/konstruktoid/hardening/issues/23
Hi,
After the OS is harden and reboot. my Jenkins service never able to start up either during boot time or using systemd to start. Please see below for more information.
I did try to disable auditd, aide and apparmor but it did not help. any suggestion will much appreciate.
Thank you so much
@konstruktoid commented on GitHub (Apr 5, 2018):
Hi @joharkwan, any logs when trying
/etc/init.d/jenkins startor in/var/log/jenkins/?@joharkwan commented on GitHub (Apr 5, 2018):
Hi @konstruktoid,
Here is /etc/init.d/jenkins start
No logs written to jenkins.log when I tried to start jenkins.
I debug /etc/init.d/jenkins script
@konstruktoid commented on GitHub (Apr 5, 2018):
Thanks, sorry to say that didn't help a lot.
Could you please specify your Ubuntu release and jenkins installation instructions, and I'll try to reproduce this behavior.
@joharkwan commented on GitHub (Apr 5, 2018):
Thanks @konstruktoid
I tried on AWS and Virtualbox all have same behavior
Jenkins installation is from
https://www.digitalocean.com/community/tutorials/how-to-install-jenkins-on-ubuntu-16-04
@konstruktoid commented on GitHub (Apr 6, 2018):
Sorry for the late reply @joharkwan, but this seems too be a rc-script - systemd service conversion error (
systemd-sysv-generator). When ignoringsystemctlby copying the jenkins init.d file to $HOME everything works fine.FYI https://issues.jenkins-ci.org/browse/JENKINS-41218
@joharkwan commented on GitHub (Apr 6, 2018):
Thank you @konstruktoid to point out JENKINS-41218
I managed to run Jenkins manually but I'm just wondering why
systemctlJenkins is not starting after the OS hardened.And the weird thing is only Jenkins service is not running other services such as NTP and Nginx run well use
systemctl@konstruktoid commented on GitHub (Apr 7, 2018):
The issue seems to be that
systemdkills the user processes when startingjenkinswithsystemctl.I wrote a jenkins .service file and added the Jenkins user to
KillExcludeUsersin/etc/systemd/logind.conf; https://gist.github.com/konstruktoid/1bc96c4f5030f37bd5f5142cc2718b35@joharkwan commented on GitHub (Apr 8, 2018):
Cool, Jenkins is able to run via
systemctlnow.Thank you so much @konstruktoid
@konstruktoid commented on GitHub (Apr 9, 2018):
You're welcome @joharkwan.
Closing :)
@arjunUnniumbath commented on GitHub (Jul 19, 2018):
I'm facing same issue in my jenkins server. @konstruktoid .
I created the jenkins.service file
and modified the logind.conf with the new values for killExcludeUsers= root jenkins
is there any other issue, which I should be aware of?
getting following error after doing start and doing journalctl -xe
root@DB:/home/dockusr2# journalctl -xe
-- Subject: Unit UNIT has finished shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- Unit UNIT has finished shutting down.
Jul 19 16:26:11 DB.QA systemd[18315]: Received SIGRTMIN+24 from PID 18334 (kill).
Jul 19 16:26:11 DB.QA systemd[18318]: pam_unix(systemd-user:session): session closed for user jenkins
Jul 19 16:26:11 DB.QA systemd[1]: Stopped User Manager for UID 117.
-- Subject: Unit user@117.service has finished shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- Unit user@117.service has finished shutting down.
Jul 19 16:26:11 DB.QA systemd[1]: Removed slice User Slice of jenkins.
-- Subject: Unit user-117.slice has finished shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- Unit user-117.slice has finished shutting down.
Jul 19 16:26:12 DB.QA. jenkins[18295]: ...fail!
Jul 19 16:26:12 DB.QA systemd[1]: jenkins.service: Control process exited, code=exited status=7
Jul 19 16:26:12 DB.QA systemd[1]: Failed to start LSB: Start Jenkins at boot time.
-- 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.
Jul 19 16:26:12 DB.QA systemd[1]: jenkins.service: Unit entered failed state.
Jul 19 16:26:12 DB.QA systemd[1]: jenkins.service: Failed with result 'exit-code'.
Jul 19 16:26:12 DB.QA sudo[18292]: pam_unix(sudo:session): session closed for user root
@konstruktoid commented on GitHub (Aug 6, 2018):
Hi @arjunUnniumbath, sorry for the late reply.
It seems the jenkins user is still getting closed.
@bendavidpaz commented on GitHub (Aug 20, 2018):
I have the same issue. jenkins on the old server just starts up and on new server it does not start.
$ journalctl -u jenkins.service
The bold files (** those surrounded by double asteriscs **) above don't exist.
If the user is root then jenkins start up.
Any ideas.
@konstruktoid commented on GitHub (Aug 21, 2018):
Hi @bendavidpaz, remove the
ProtectHome=trueandProtectSystem=fullsettings in the .service file in order too exclude any problem with stricter systemd settings.@saurabh896 commented on GitHub (Mar 12, 2020):
Install default jdk solved my problem
@warheads commented on GitHub (Mar 24, 2020):
Thanks @saurabh896, installing default JDk really helped..!!!!
@bugb commented on GitHub (Mar 12, 2021):
Nice! Thanks a lot @konstruktoid konstruktoid c
@azizonick commented on GitHub (Feb 13, 2022):
@konstruktoid
Hey there, facing the same issue, systemctl doesnt stop doesn trigger the server however "sh jenkins stop" does, and when i kill it manually, systemctl command stucks and does not return back to shell on Centos 7
@konstruktoid commented on GitHub (Feb 14, 2022):
Hi @azizonick, this is a repository regarding ubuntu security and I don't have any real experience with jenkins on centos.
I wish you the best of luck finding an answer, but I think someone more focused on centos can provide a much better answer.
@parthgofficial commented on GitHub (Mar 12, 2022):
Hi @konstruktoid
Getting the same error please help!
-- The result is failed.
Mar 12 12:31:31 ip-172-31-83-21.ec2.internal systemd[1]: Unit jenkins.service entered failed
Mar 12 12:31:31 ip-172-31-83-21.ec2.internal systemd[1]: jenkins.service failed.
Mar 12 12:31:31 ip-172-31-83-21.ec2.internal systemd[1]: jenkins.service holdoff time over, s
Mar 12 12:31:31 ip-172-31-83-21.ec2.internal systemd[1]: Stopped Jenkins Continuous Integrati
-- 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 12:31:31 ip-172-31-83-21.ec2.internal systemd[1]: start request repeated too quickly f
Mar 12 12:31:31 ip-172-31-83-21.ec2.internal systemd[1]: Failed to start Jenkins Continuous I
-- 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 12:31:31 ip-172-31-83-21.ec2.internal systemd[1]: Unit jenkins.service entered failed
Mar 12 12:31:31 ip-172-31-83-21.ec2.internal systemd[1]: jenkins.service failed.
Mar 12 12:32:19 ip-172-31-83-21.ec2.internal dhclient[2848]: XMT: Solicit on eth0, interval 1
lines 1978-1999/1999 (END)
@konstruktoid commented on GitHub (Mar 12, 2022):
Yeah, it seems to have failed, but do you have any logs that state why it failed, and is that error actually caused by code in this repository?
@parthgofficial commented on GitHub (Mar 12, 2022):
Mar 12 12:15:46 ip-172-31-83-21.ec2.internal systemd[1]: Starting Jenkins Continuous Integration Server...
Mar 12 12:15:46 ip-172-31-83-21.ec2.internal jenkins[8563]: openjdk version "17.0.2" 2022-01-18 LTS
Mar 12 12:15:46 ip-172-31-83-21.ec2.internal jenkins[8563]: OpenJDK Runtime Environment Corretto-17.0.2.8.1 (build 17.0.2+8-LTS)
Mar 12 12:15:46 ip-172-31-83-21.ec2.internal jenkins[8563]: OpenJDK 64-Bit Server VM Corretto-17.0.2.8.1 (build 17.0.2+8-LTS, mixed mode, sharing)
Mar 12 12:15:46 ip-172-31-83-21.ec2.internal systemd[1]: jenkins.service: main process exited, code=exited, status=1/FAILURE
Mar 12 12:15:46 ip-172-31-83-21.ec2.internal systemd[1]: Failed to start Jenkins Continuous Integration Server.
Mar 12 12:15:46 ip-172-31-83-21.ec2.internal systemd[1]: Unit jenkins.service entered failed state.
Mar 12 12:15:46 ip-172-31-83-21.ec2.internal systemd[1]: jenkins.service failed.
Mar 12 12:15:47 ip-172-31-83-21.ec2.internal systemd[1]: jenkins.service holdoff time over, scheduling restart.
Mar 12 12:15:47 ip-172-31-83-21.ec2.internal systemd[1]: Stopped Jenkins Continuous Integration Server.
Mar 12 12:15:47 ip-172-31-83-21.ec2.internal systemd[1]: Starting Jenkins Continuous Integration Server...
Mar 12 12:15:47 ip-172-31-83-21.ec2.internal jenkins[8615]: openjdk version "17.0.2" 2022-01-18 LTS
Mar 12 12:15:47 ip-172-31-83-21.ec2.internal jenkins[8615]: OpenJDK Runtime Environment Corretto-17.0.2.8.1 (build 17.0.2+8-LTS)
Mar 12 12:15:47 ip-172-31-83-21.ec2.internal jenkins[8615]: OpenJDK 64-Bit Server VM Corretto-17.0.2.8.1 (build 17.0.2+8-LTS, mixed mode, sharing)
Mar 12 12:15:47 ip-172-31-83-21.ec2.internal systemd[1]: jenkins.service: main process exited, code=exited, status=1/FAILURE
Mar 12 12:15:47 ip-172-31-83-21.ec2.internal systemd[1]: Failed to start Jenkins Continuous Integration Server.
Mar 12 12:15:47 ip-172-31-83-21.ec2.internal systemd[1]: Unit jenkins.service entered failed state.
Mar 12 12:15:47 ip-172-31-83-21.ec2.internal systemd[1]: jenkins.service failed.
Mar 12 12:15:47 ip-172-31-83-21.ec2.internal systemd[1]: jenkins.service holdoff time over, scheduling restart.
Mar 12 12:15:47 ip-172-31-83-21.ec2.internal systemd[1]: Stopped Jenkins Continuous Integration Server.
Mar 12 12:15:47 ip-172-31-83-21.ec2.internal systemd[1]: Starting Jenkins Continuous Integration Server...
Mar 12 12:15:47 ip-172-31-83-21.ec2.internal jenkins[8673]: openjdk version "17.0.2" 2022-01-18 LTS
Mar 12 12:15:47 ip-172-31-83-21.ec2.internal jenkins[8673]: OpenJDK Runtime Environment Corretto-17.0.2.8.1 (build 17.0.2+8-LTS)
Mar 12 12:15:47 ip-172-31-83-21.ec2.internal jenkins[8673]: OpenJDK 64-Bit Server VM Corretto-17.0.2.8.1 (build 17.0.2+8-LTS, mixed mode, sharing)
Mar 12 12:15:47 ip-172-31-83-21.ec2.internal systemd[1]: jenkins.service: main process exited, code=exited, status=1/FAILURE
Mar 12 12:15:47 ip-172-31-83-21.ec2.internal systemd[1]: Failed to start Jenkins Continuous Integration Server.
Mar 12 12:15:47 ip-172-31-83-21.ec2.internal systemd[1]: Unit jenkins.service entered failed state.
Mar 12 12:15:47 ip-172-31-83-21.ec2.internal systemd[1]: jenkins.service failed.
lines 1-29
@konstruktoid commented on GitHub (Mar 12, 2022):
Are there any actual Jenkins logs? And how is this related to this repository?
@mangesh-bhosale commented on GitHub (Feb 3, 2023):
● jenkins.service - Jenkins Continuous Integration Server
Loaded: loaded (/lib/systemd/system/jenkins.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Fri 2023-02-03 06:00:17 UTC; 13s ago
Process: 15524 ExecStart=/usr/bin/jenkins (code=exited, status=1/FAILURE)
Main PID: 15524 (code=exited, status=1/FAILURE)
Feb 03 06:00:17 ip-172-31-43-178.ap-south-1.compute.internal systemd[1]: jenkins.service: Main process exited, code=exited, status=1/FAILURE
Feb 03 06:00:17 ip-172-31-43-178.ap-south-1.compute.internal systemd[1]: jenkins.service: Failed with result 'exit-code'.
Feb 03 06:00:17 ip-172-31-43-178.ap-south-1.compute.internal systemd[1]: Failed to start Jenkins Continuous Integration Server.
Feb 03 06:00:17 ip-172-31-43-178.ap-south-1.compute.internal systemd[1]: jenkins.service: Service hold-off time over, scheduling restart.
Feb 03 06:00:17 ip-172-31-43-178.ap-south-1.compute.internal systemd[1]: jenkins.service: Scheduled restart job, restart counter is at 5.
Feb 03 06:00:17 ip-172-31-43-178.ap-south-1.compute.internal systemd[1]: Stopped Jenkins Continuous Integration Server.
Feb 03 06:00:17 ip-172-31-43-178.ap-south-1.compute.internal systemd[1]: jenkins.service: Start request repeated too quickly.
Feb 03 06:00:17 ip-172-31-43-178.ap-south-1.compute.internal systemd[1]: jenkins.service: Failed with result 'exit-code'.
Feb 03 06:00:17 ip-172-31-43-178.ap-south-1.compute.internal systemd[1]: Failed to start Jenkins Continuous Integration Server.
root@ip-172-31-43-178:
# sudo vi /etc/init.d/jenkins# systemctl status jenkins.serviceroot@ip-172-31-43-178:
● jenkins.service - Jenkins Continuous Integration Server
Loaded: loaded (/lib/systemd/system/jenkins.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Fri 2023-02-03 06:00:17 UTC; 56s ago
Process: 15524 ExecStart=/usr/bin/jenkins (code=exited, status=1/FAILURE)
Main PID: 15524 (code=exited, status=1/FAILURE)
@mangesh-bhosale commented on GitHub (Feb 3, 2023):
How to resolve this error ?tried to install Jenkins on Ubuntu 18.04 -Ec2 instance
@konstruktoid commented on GitHub (Feb 3, 2023):
Are there any actual Jenkins logs? And how is this related to this repository?