Migrate the Jenkins service from systemv to systemd

Currently we are using the Jenkins 2.401.3, Initially we started with Jenkins installation 2.235.5 and upgraded the Jenkins using war files. Please suggest how to proceed to move the services from systemv to systemd.

Following version upgrades are done.

2.235.5 >> 2.277.4 >> 2.346.2 >> 2.375.1 >> 2.387.3 >> 2.401.3

Problem statement:

We have identified that Jenkins services are running as systemv from beginning and since we are using war file upgrades the services are not moved to systemd.

Is there a way to move the Jenkins service from systemv to systemd?

My package installation output shows below

apt list | grep jenkins

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

jenkins-debian-glue-buildenv/focal 0.20.1 all

jenkins-debian-glue/focal 0.20.1 all

jenkins-job-builder-doc/focal 3.2.0-1 all

jenkins-job-builder/focal 3.2.0-1 all

jenkins/binary 2.387.1 all [upgradable from: 2.235.5]

libjenkins-htmlunit-core-js-java/focal 2.6-hudson-1-1fakesync1 all

libjenkins-json-java-doc/focal 2.4-jenkins-3-5 all

libjenkins-json-java/focal 2.4-jenkins-3-5 all

libjenkins-trilead-ssh2-java-doc/focal 217-jenkins-8-1 all

libjenkins-trilead-ssh2-java/focal 217-jenkins-8-1 all

python-jenkins-doc/focal 0.4.16-1 all

python3-jenkins-job-builder/focal 3.2.0-1 all

python3-jenkins/focal 0.4.16-1 all

python3-jenkinsapi/focal 0.3.11-1ubuntu1 all

Please suggest how to proceed to move the services from systemv to systemd.

That’s not a scenario that is tested by the Jenkins project, so this is just a guess. I think that you should use apt or apt-get to perform the upgrade of Jenkins.

It may complain that you’ve modified one of the files in the original package. That complaint is correct since you’ve updated jenkins.war with a newer version than the original installation. You’ll need to resolve that complaint. Usually, system utilities like apt-get will recommend what you need to do in order to resolve their complaints.

@MarkEWaite Thank you for your response.
Currently we are on LTS Jenkins 2.401.3 if i upgrade using apt upgrade jenkins does it migrate the services from system v to system d?
Or the service migration is supported only on the older upgrade installations?
Just curios to understand how installer behaves.

Yes, it migrates from System V init to systemd when it detects that the migration is needed.