Skip to content
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

Require Debian 10 / Ubuntu 20.04 or newer, include jenkins.tmpfiles #456

Merged
merged 1 commit into from Mar 24, 2024

Conversation

TobiX
Copy link
Contributor

@TobiX TobiX commented Mar 22, 2024

This updates the debhelper compat level when building a Debian package from 10 to 13. This fixes #455, since the file introduced in #442 is picked up in the newer compat level.

This introces a new Pre-Depends (see the changelog for compat level 12) on init-system-helpers (>= 1.54~) which should be satisfiable in Debian >= 10 and Ubuntu >= 20.04, which should match Jenkins' support policy AFAICS.

Testing done

Build package using

make deb WAR=$PWD/jenkins.war MSI= CREDENTIAL=$PWD/credentials/test.mk

in the jenkinsciinfra/packaging:latest build image and installed in a debian:12 for verification that it still works and expected files are installed.

PS: I had to change the author in branding/test.mk to

export AUTHOR=Bogus Test (This is test only key) <noreply@jenkins-ci.org>

since debsign is using the package author field to find the secret GPG key...

Diffoscope report

Here is a difference between the package built without my change and with my change as reported by diffoscope:

Report
--- target/debian/jenkinstest_2.440.2_all.old.deb
+++ target/debian/jenkinstest_2.440.2_all.new.deb
├── file list
│ @@ -1,3 +1,3 @@
│  -rw-r--r--   0        0        0        4 2024-03-22 12:37:00.000000 debian-binary
│ --rw-r--r--   0        0        0     2792 2024-03-22 12:37:00.000000 control.tar.xz
│ --rw-r--r--   0        0        0 85780176 2024-03-22 12:37:00.000000 data.tar.xz
│ +-rw-r--r--   0        0        0     3000 2024-03-22 12:37:00.000000 control.tar.xz
│ +-rw-r--r--   0        0        0 85780336 2024-03-22 12:37:00.000000 data.tar.xz
├── control.tar.xz
│ ├── control.tar
│ │ ├── file list
│ │ │ @@ -1,7 +1,7 @@
│ │ │  drwxr-xr-x   0 root         (0) root         (0)        0 2024-03-22 12:37:00.000000 ./
│ │ │  -rw-r--r--   0 root         (0) root         (0)       78 2024-03-22 12:37:00.000000 ./conffiles
│ │ │ --rw-r--r--   0 root         (0) root         (0)      889 2024-03-22 12:37:00.000000 ./control
│ │ │ --rw-r--r--   0 root         (0) root         (0)      399 2024-03-22 12:37:00.000000 ./md5sums
│ │ │ --rwxr-xr-x   0 root         (0) root         (0)     4060 2024-03-22 12:37:00.000000 ./postinst
│ │ │ --rwxr-xr-x   0 root         (0) root         (0)     1423 2024-03-22 12:37:00.000000 ./postrm
│ │ │ --rwxr-xr-x   0 root         (0) root         (0)      237 2024-03-22 12:37:00.000000 ./prerm
│ │ │ +-rw-r--r--   0 root         (0) root         (0)      933 2024-03-22 12:37:00.000000 ./control
│ │ │ +-rw-r--r--   0 root         (0) root         (0)      469 2024-03-22 12:37:00.000000 ./md5sums
│ │ │ +-rwxr-xr-x   0 root         (0) root         (0)     5028 2024-03-22 12:37:00.000000 ./postinst
│ │ │ +-rwxr-xr-x   0 root         (0) root         (0)     1626 2024-03-22 12:37:00.000000 ./postrm
│ │ │ +-rwxr-xr-x   0 root         (0) root         (0)      502 2024-03-22 12:37:00.000000 ./prerm
│ │ ├── ./control
│ │ │ @@ -1,12 +1,13 @@
│ │ │  Package: jenkinstest
│ │ │  Version: 2.440.2
│ │ │  Architecture: all
│ │ │  Maintainer: Bogus Test (This is test only key) <noreply@jenkins-ci.org>
│ │ │ -Installed-Size: 84529
│ │ │ +Installed-Size: 84533
│ │ │ +Pre-Depends: init-system-helpers (>= 1.54~)
│ │ │  Depends: adduser, lsb-base (>= 3.2-14), net-tools, sysvinit-utils (>= 2.88dsf-50)
│ │ │  Section: devel
│ │ │  Priority: optional
│ │ │  Homepage: http://test.jenkins.io/
│ │ │  Description: Jenkins is the leading open source automation server supported by a large and growing community of developers, testers, designers and other people interested in continuous integration, continuous delivery and modern software delivery practices. Built on the Java Virtual Machine (JVM), it provides more than 1,800 plugins that extend Jenkins to automate with practically any technology software delivery teams use. In 2022, Jenkins reached 300,000 known installations making it the most widely deployed automation server.
│ │ │   .
│ │ │   For more information, see https://www.jenkins.io.
│ │ ├── ./md5sums
│ │ │ ├── ./md5sums
│ │ │ │┄ Files differ
│ │ │ ├── line order
│ │ │ │ @@ -1,6 +1,7 @@
│ │ │ │  lib/systemd/system/jenkinstest.service
│ │ │ │  usr/bin/jenkinstest
│ │ │ │ +usr/lib/tmpfiles.d/jenkinstest.conf
│ │ │ │  usr/share/doc/jenkinstest/changelog.gz
│ │ │ │  usr/share/doc/jenkinstest/copyright
│ │ │ │  usr/share/java/jenkinstest.war
│ │ │ │  usr/share/jenkinstest/migrate
│ │ ├── ./postinst
│ │ │ @@ -71,15 +71,37 @@
│ │ │   exit 1
│ │ │   ;;
│ │ │  esac
│ │ │
│ │ │  # dh_installdeb will replace this with shell code automatically
│ │ │  # generated by other debhelper scripts.
│ │ │
│ │ │ -# Automatically added by dh_systemd_enable/13.6ubuntu1
│ │ │ +# Automatically added by dh_installtmpfiles/13.6ubuntu1
│ │ │ +if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
│ │ │ + # In case this system is running systemd, we need to ensure that all
│ │ │ + # necessary tmpfiles (if any) are created before starting.
│ │ │ + if [ -z "${DPKG_ROOT:-}" ] && [ -d /run/systemd/system ] ; then
│ │ │ +         systemd-tmpfiles --create jenkinstest.conf >/dev/null || true
│ │ │ + fi
│ │ │ +fi
│ │ │ +# End automatically added section
│ │ │ +# Automatically added by dh_installinit/13.6ubuntu1
│ │ │ +if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
│ │ │ + if [ -z "${DPKG_ROOT:-}" ] && [ -x "/etc/init.d/jenkinstest" ]; then
│ │ │ +         update-rc.d jenkinstest defaults >/dev/null
│ │ │ +         if [ -n "$2" ]; then
│ │ │ +                 _dh_action=restart
│ │ │ +         else
│ │ │ +                 _dh_action=start
│ │ │ +         fi
│ │ │ +         invoke-rc.d --skip-systemd-native jenkinstest $_dh_action || exit 1
│ │ │ + fi
│ │ │ +fi
│ │ │ +# End automatically added section
│ │ │ +# Automatically added by dh_installsystemd/13.6ubuntu1
│ │ │  if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
│ │ │   # This will only remove masks created by d-s-h on package removal.
│ │ │   deb-systemd-helper unmask 'jenkinstest.service' >/dev/null || true
│ │ │
│ │ │   # was-enabled defaults to true, so new installations run enable.
│ │ │   if deb-systemd-helper --quiet was-enabled 'jenkinstest.service'; then
│ │ │           # Enables the unit on first installation, creates new
│ │ │ @@ -88,23 +110,23 @@
│ │ │   else
│ │ │           # Update the statefile to add new symlinks (if any), which need to be
│ │ │           # cleaned up on purge. Also remove old symlinks.
│ │ │           deb-systemd-helper update-state 'jenkinstest.service' >/dev/null || true
│ │ │   fi
│ │ │  fi
│ │ │  # End automatically added section
│ │ │ -# Automatically added by dh_installinit/13.6ubuntu1
│ │ │ +# Automatically added by dh_installsystemd/13.6ubuntu1
│ │ │  if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
│ │ │ - if [ -z "${DPKG_ROOT:-}" ] && [ -x "/etc/init.d/jenkinstest" ]; then
│ │ │ -         update-rc.d jenkinstest defaults >/dev/null
│ │ │ + if [ -d /run/systemd/system ]; then
│ │ │ +         systemctl --system daemon-reload >/dev/null || true
│ │ │           if [ -n "$2" ]; then
│ │ │                   _dh_action=restart
│ │ │           else
│ │ │                   _dh_action=start
│ │ │           fi
│ │ │ -         invoke-rc.d jenkinstest $_dh_action || exit 1
│ │ │ +         deb-systemd-invoke $_dh_action 'jenkinstest.service' >/dev/null || true
│ │ │   fi
│ │ │  fi
│ │ │  # End automatically added section
│ │ │
│ │ │
│ │ │  exit 0
│ │ ├── ./postrm
│ │ │ @@ -28,15 +28,20 @@
│ │ │  esac
│ │ │
│ │ │  # Automatically added by dh_installinit/13.6ubuntu1
│ │ │  if [ -z "${DPKG_ROOT:-}" ] && [ "$1" = "purge" ] ; then
│ │ │   update-rc.d jenkinstest remove >/dev/null
│ │ │  fi
│ │ │  # End automatically added section
│ │ │ -# Automatically added by dh_systemd_enable/13.6ubuntu1
│ │ │ +# Automatically added by dh_installsystemd/13.6ubuntu1
│ │ │ +if [ "$1" = remove ] && [ -d /run/systemd/system ] ; then
│ │ │ + systemctl --system daemon-reload >/dev/null || true
│ │ │ +fi
│ │ │ +# End automatically added section
│ │ │ +# Automatically added by dh_installsystemd/13.6ubuntu1
│ │ │  if [ "$1" = "remove" ]; then
│ │ │   if [ -x "/usr/bin/deb-systemd-helper" ]; then
│ │ │           deb-systemd-helper mask 'jenkinstest.service' >/dev/null || true
│ │ │   fi
│ │ │  fi
│ │ │
│ │ │  if [ "$1" = "purge" ]; then
│ │ ├── ./prerm
│ │ │ @@ -1,7 +1,12 @@
│ │ │  #!/bin/sh
│ │ │  set -e
│ │ │ +# Automatically added by dh_installsystemd/13.6ubuntu1
│ │ │ +if [ -z "${DPKG_ROOT:-}" ] && [ "$1" = remove ] && [ -d /run/systemd/system ] ; then
│ │ │ + deb-systemd-invoke stop 'jenkinstest.service' >/dev/null || true
│ │ │ +fi
│ │ │ +# End automatically added section
│ │ │  # Automatically added by dh_installinit/13.6ubuntu1
│ │ │  if [ -z "${DPKG_ROOT:-}" ] && [ "$1" = remove ] && [ -x "/etc/init.d/jenkinstest" ] ; then
│ │ │ - invoke-rc.d jenkinstest stop || exit 1
│ │ │ + invoke-rc.d --skip-systemd-native jenkinstest stop || exit 1
│ │ │  fi
│ │ │  # End automatically added section
├── data.tar.xz
│ ├── data.tar
│ │ ├── file list
│ │ │ @@ -9,14 +9,17 @@
│ │ │  drwxr-xr-x   0 root         (0) root         (0)        0 2024-03-22 12:37:00.000000 ./lib/
│ │ │  drwxr-xr-x   0 root         (0) root         (0)        0 2024-03-22 12:37:00.000000 ./lib/systemd/
│ │ │  drwxr-xr-x   0 root         (0) root         (0)        0 2024-03-22 12:37:00.000000 ./lib/systemd/system/
│ │ │  -rw-r--r--   0 root         (0) root         (0)     5648 2024-03-22 12:37:00.000000 ./lib/systemd/system/jenkinstest.service
│ │ │  drwxr-xr-x   0 root         (0) root         (0)        0 2024-03-22 12:37:00.000000 ./usr/
│ │ │  drwxr-xr-x   0 root         (0) root         (0)        0 2024-03-22 12:37:00.000000 ./usr/bin/
│ │ │  -rwxr-xr-x   0 root         (0) root         (0)     4600 2024-03-22 12:37:00.000000 ./usr/bin/jenkinstest
│ │ │ +drwxr-xr-x   0 root         (0) root         (0)        0 2024-03-22 12:37:00.000000 ./usr/lib/
│ │ │ +drwxr-xr-x   0 root         (0) root         (0)        0 2024-03-22 12:37:00.000000 ./usr/lib/tmpfiles.d/
│ │ │ +-rw-r--r--   0 root         (0) root         (0)       38 2024-03-22 12:37:00.000000 ./usr/lib/tmpfiles.d/jenkinstest.conf
│ │ │  drwxr-xr-x   0 root         (0) root         (0)        0 2024-03-22 12:37:00.000000 ./usr/share/
│ │ │  drwxr-xr-x   0 root         (0) root         (0)        0 2024-03-22 12:37:00.000000 ./usr/share/doc/
│ │ │  drwxr-xr-x   0 root         (0) root         (0)        0 2024-03-22 12:37:00.000000 ./usr/share/doc/jenkinstest/
│ │ │  -rw-r--r--   0 root         (0) root         (0)      180 2024-03-22 12:37:00.000000 ./usr/share/doc/jenkinstest/changelog.gz
│ │ │  -rw-r--r--   0 root         (0) root         (0)     1523 2024-03-22 12:37:00.000000 ./usr/share/doc/jenkinstest/copyright
│ │ │  drwxr-xr-x   0 root         (0) root         (0)        0 2024-03-22 12:37:00.000000 ./usr/share/java/
│ │ │  -rwxr-xr-x   0 root         (0) root         (0) 86482142 2024-03-22 12:37:00.000000 ./usr/share/java/jenkinstest.war

Formatted HTML report

PPS: For reproducibility I had to fudge the timestamp in the Debian changelog (which is used for all files in the package)

Submitter checklist

Edit tasklist title
Beta Give feedback Tasklist Submitter checklist, more options

Delete tasklist

Delete tasklist block?
Are you sure? All relationships in this tasklist will be removed.
  1. Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
    Options
  2. Ensure that the pull request title represents the desired changelog entry
    Options
  3. Please describe what you did
    Options
  4. Link to relevant issues in GitHub or Jira
    Options
  5. Link to relevant pull requests, esp. upstream and downstream changes
    Options
  6. Ensure you have provided tests - that demonstrates feature works or fixes the issue
    Options

@TobiX TobiX requested a review from a team as a code owner March 22, 2024 14:34
@basil basil requested a review from darinpope March 22, 2024 18:25
@MarkEWaite MarkEWaite changed the title Update debhelper compat level to 13 Include jenkins.tmpfiles in Debian package, update debhelper compat level to 13 Mar 23, 2024
@MarkEWaite MarkEWaite changed the title Include jenkins.tmpfiles in Debian package, update debhelper compat level to 13 Include jenkins.tmpfiles in Debian package, require Debian 10 / Ubuntu 20.04 or newer Mar 23, 2024
@MarkEWaite MarkEWaite changed the title Include jenkins.tmpfiles in Debian package, require Debian 10 / Ubuntu 20.04 or newer Require Debian 10 / Ubuntu 20.04 or newer, include jenkins.tmpfiles for Unix domain socket Mar 23, 2024
@MarkEWaite MarkEWaite changed the title Require Debian 10 / Ubuntu 20.04 or newer, include jenkins.tmpfiles for Unix domain socket Require Debian 10 / Ubuntu 20.04 or newer, include jenkins.tmpfiles Mar 23, 2024
Copy link
Contributor

@MarkEWaite MarkEWaite left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks very much!

I built the package on my Debian testing installation and confirmed that it installed as expected. In my test environment, it created a package named "jenkinstest" that installed and ran on port 7777.

We'll need to mention this in the Jenkins weekly changelog the week after it is merged, because there will be users that have ignored the "unsupported operating system" warnings and are still running on unsupported operating systems like Ubuntu 18.04 and Debian 9.

@MarkEWaite MarkEWaite merged commit e5be069 into jenkinsci:master Mar 24, 2024
3 checks passed
@MarkEWaite
Copy link
Contributor

@kmartens27 don't miss including this in the weekly changelog and in the LTS changelog.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

jenkins.tmpfiles missing from Debian package
3 participants