-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for systemd
#266
Support for systemd
#266
Conversation
First successful CI test run with We now have a distribution-agnostic The main work that remains is the migration script to copy over old settings from |
I implemented a migration routine for all three targets and did some light testing. It seems to work fine. I'll continue to do more extensive testing, but at this point I think this change is ready for review. |
Tested "Restart Jenkins when installation is complete and no jobs are running" with |
@serianox you need to change the type to |
@axmetishe To channel some of Kohsuke's energy:
Or to channel the energy of the late Roger Faulkner:
My main objective for this PR is not to cause a regression for the thousands of users with existing installations who will be running As @timja mentioned, this is a v1. There is room for improvement. People should feel free to propose new PRs with their ideas for improvement once this PR is merged. We now have CI build/test automation using Ansible, so this repository has become friendlier to first-time contributors. Yes, we can remove the old System V init scripts. Yes, we can optimize startup time with regard to networking. Yes, we can make the shell scripts squeaky clean or possibly eliminate them altogether. But we can't do any of this if we don't first ship this PR and migrate our existing install base to Let's cross that bridge first and polish everything up on the other side. Join me in doing so. |
We are running multiple Jenkins LTS 2.319.2 instances on Devuan 4 and Debian 11 without SystemD. Both systems are running on I installed the .deb file from build 36 Configuration file '/etc/default/jenkins'
==> Modified (by you or by a script) since installation.
==> Package distributor has shipped an updated version.
What would you like to do about it ? Your options are:
Y or I : install the package maintainer's version
N or O : keep your currently-installed version
D : show the differences between the versions
Z : start a shell to examine the situation
The default action is to keep your current version.
*** jenkins (Y/I/N/O/D/Z) [default=N] ? n
Installing new version of config file /etc/init.d/jenkins ...
insserv: warning: script 'savecache' missing LSB tags
insserv: Default-Start undefined, assuming empty start runlevel(s) for script `savecache'
insserv: Default-Stop undefined, assuming empty stop runlevel(s) for script `savecache'
Restarting Jenkins Automation Server: jenkinsCorrect java version found
Correct java version found
Setting up max open files limit to 8192
failed!
invoke-rc.d: initscript jenkins, action "restart" failed.
dpkg: error processing package jenkins (--install):
installed jenkins package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
jenkins I then did a quick edit of # location of the jenkins war file
-JENKINS_WAR=/usr/share/$NAME/$NAME.war
+JENKINS_WAR=/usr/share/java/$NAME.war After this edit, Jenkins started successfully with
I would like to please request that this is not done in the future as we are surely not the only people running Jenkins on Debian without SystemD. |
Thanks for testing. I performed a similar test on my Debian 11 machine that was configured behind a reverse proxy. The Debian standard handling of the modified file I assume that modifying the |
My suggestion was limited to RPM or even just Red Hat where there is no sysvinit anymore. You are correct that Debian does give the choice. |
@MarkEWaite Correct, there are no hard conflicts requiring mechanical merge resolution in |
The `--javahome` argument that was listed there is rejected by Jenkins when it is included in the JENKINS_ARGS variable. The `--javaHome` argument is accepted by Jenkins but does not seem to set the JAVA_HOME environment variable in Jenkins 2.330 on Debian 11. The JAVA_HOME environment variable is not shown in Jenkins 2.330 in the "Manage Jenkins" -> "System Information" page of Jenkins 2.330 and is not shown in the environment variable list reported by a job run on the Jenkins 2.330 controller. The `--javaHome` argument is accepted by Jenkins and sets the JAVA_HOME environment variable in Jenkins 2.333 when using pull request jenkinsci#266 (systemd support) and is shown in the environment variable list reported by a job run on the Jenkins 2.333 controller installed with the systemd support provided in pull request jenkinsci#266.
I've run a series of successful upgrade tests experimenting with:
There was an unexpected entry in the output of
I've also reviewed the documentation pull request and commented there. |
I ran an upgrade test on Debian 10 that started with Jenkins 2.331 customized to use /opt/jdk-11 as JAVA_HOME, port 9090, custom garbage collection arguments, and In order to use a custom Java in 2.331, I set When I followed the instructions in the systemd configuration file to set |
I ran an upgrade test on my Red Hat Enterprise Linux 8.5 installation with a custom prefix, custom Java installation, and environment variable settings for configuration as code. The I'd like a little more time to use the list of fixed bugs as ideas for more exploration. I think that my exploratory tests could be completed as early as end of day Monday. It would be nice to have a blog post that describes the changes and the ways that systemd makes things easier and simpler than the System V init process. |
Marking as on hold till after Wednesday security release. |
Not just the Wednesday security release, but this PR will have to wait until after this repository has branched for the stable March LTS, as the API changes in core for |
we can cut that whenever, and just exclude this, I wouldn't hold off for that 😄 |
Branch was created by the looks of it: https://github.com/jenkinsci/packaging/commits/stable-2.332 This PR is now ready for merge, after ~24 hours, we will merge it if there's no negative feedback. Thanks! |
@ekohl Thanks. For the record, I think the correct type is |
Last couple of runs failed CI FYI @basil Looks like it is Error: Problem: package but none of the providers can be installed cannot install both cannot install the best candidate for the job
|
There's a CI fix in #283 which is unrelated to this PR so will ship anyway |
Jenkins versions >=2.332.1 ship the jenkins.war now as /usr/share/java/jenkins.war, and no longer as /usr/share/jenkins/jenkins.war. Change from upstream took place in jenkinsci/packaging#266 FTR, current upstream version of the jenkins systemd service unit: $ grep -v '^#' /lib/systemd/system/jenkins.service | sed '/^$/d' [Unit] Description=Jenkins Continuous Integration Server Requires=network.target After=network.target [Service] Type=notify NotifyAccess=main ExecStart=/usr/bin/jenkins Restart=on-failure SuccessExitStatus=143 User=jenkins Group=jenkins Environment="JENKINS_HOME=/var/lib/jenkins" WorkingDirectory=/var/lib/jenkins Environment="JENKINS_WEBROOT=%C/jenkins/war" Environment="JAVA_OPTS=-Djava.awt.headless=true" Environment="JENKINS_PORT=8080" [Install] WantedBy=multi-user.target Change-Id: I8349fdfc5028f5bcc9903a79f26e5a685643a618
Downstream of jenkins-infra/docker-packaging#29. Beginnings of a common
systemd.service(5)
unit configuration for thedeb
,rpm
, andsuse
targets.Should fix most if not all of the following bugs:
Fixes #216