Not able to start Jenkins in linux

HI Team

Getting below error when we start the Jenkins.service

Jenkins.service is updated to auto start when server reboots, so after server reboot, not able to start the service, keep getting error msg.

udo systemctl start jenkins.service 

Job for jenkins.service failed because the control process exited with error code. See "systemctl status jenkins.service" and "journalctl -xe" for details.
[user@server opt]$ sudo journalctl -xe
Jan 31 08:46:56 server jenkins[13231]: at winstone.Launcher.main(Launcher.java:405)
Jan 31 08:46:56 server jenkins[13231]: at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
Jan 31 08:46:56 server jenkins[13231]: at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:6
Jan 31 08:46:56 server jenkins[13231]: at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImp
Jan 31 08:46:56 server jenkins[13231]: at java.base/java.lang.reflect.Method.invoke(Method.java:566)
Jan 31 08:46:56 server jenkins[13231]: at executable.Main._main(Main.java:334)
Jan 31 08:46:56 server jenkins[13231]: at executable.Main.main(Main.java:116)
Jan 31 08:46:58 server systemd[1]: jenkins.service: main process exited, code=exited, status=1/FAILURE
Jan 31 08:46:58 server systemd[1]: Failed to start LSB: Jenkins Automation Server.
-- Subject: Unit jenkins.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit jenkins.service has failed.

journalctl -xe logs

Jan 30 19:12:54 server jenkins[30877]: 2023-01-31 01:12:54.340+0000 [id=1]        SEVERE        winstone.Logger#logInternal: Container startup failed
Jan 30 19:12:54 server jenkins[30877]: winstone.WinstoneException: Please set --httpsKeyStore
Jan 30 19:12:54 server jenkins[30877]: at winstone.AbstractSecuredConnectorFactory.configureSsl(AbstractSecuredConnectorFactory.java:88)
Jan 30 19:12:54 server jenkins[30877]: at winstone.HttpsConnectorFactory.start(HttpsConnectorFactory.java:54)
Jan 30 19:12:54 server jenkins[30877]: at winstone.Launcher.spawnListener(Launcher.java:255)
Jan 30 19:12:54 server jenkins[30877]: Caused: java.io.IOException: Failed to start a listener: winstone.HttpsConnectorFactory
Jan 30 19:12:54 server jenkins[30877]: at winstone.Launcher.spawnListener(Launcher.java:261)
Jan 30 19:12:54 server jenkins[30877]: at winstone.Launcher.<init>(Launcher.java:190)
Jan 30 19:12:54 server jenkins[30877]: at winstone.Launcher.main(Launcher.java:405)
Jan 30 19:12:54 server jenkins[30877]: at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
Jan 30 19:12:54 server jenkins[30877]: at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
Jan 30 19:12:54 server jenkins[30877]: at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
Jan 30 19:12:54 server jenkins[30877]: at java.base/java.lang.reflect.Method.invoke(Method.java:566)
Jan 30 19:12:54 server jenkins[30877]: at executable.Main._main(Main.java:334)
Jan 30 19:12:54 server jenkins[30877]: at executable.Main.main(Main.java:116)
Jan 30 19:12:55 server sudo[30606]: pam_unix(sudo:session): session closed for user root
Jan 30 19:12:56 server systemd[1]: jenkins.service: main process exited, code=exited, status=1/FAILURE
Jan 30 19:12:56 server systemd[1]: Failed to start LSB: Jenkins Automation 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.
Jan 30 19:12:56 server systemd[1]: Unit jenkins.service entered failed state.
Jan 30 19:12:56 server systemd[1]: jenkins.service failed.
Jan 30 19:12:56 server systemd[1]: jenkins.service holdoff time over, scheduling restart.

Thanks and appreciate any help on this.

That likely means that you are either passing arguments that are no longer supported or you are not passing the correct arguments. That output likely hints that you’re trying to use Jenkins to provide https end point termination but haven’t provided the correct arguments to do it.

1 Like

Here is the Jenkins.service file

cat jenkins.service
# Automatically generated by systemd-sysv-generator

[Unit]
Documentation=man:systemd-sysv-generator(8)
SourcePath=/etc/rc.d/init.d/jenkins
Description=LSB: Jenkins Automation Server
Requires=network.target
After=network.target
After=multi-user.target

[Service]
Type=notify
NotifyAccess=main
#ExecStart=/usr/bin/jenkins --webroot=/var/cache/jenkins/war --httpsPort=8443
Restart=on-failure
SuccessExitStatus=143

#Restart=no
#TimeoutSec=15min
#IgnoreSIGPIPE=no
#KillMode=process
#GuessMainPID=no
#RemainAfterExit=yes
#ExecStart=/etc/rc.d/init.d/jenkins start
ExecStart=/usr/bin/java -jar /usr/lib/jenkins/jenkins.war --webroot=/var/cache/jenkins/war --httpPort=8081 --ajp13Port=-1
ExecStop=/etc/rc.d/init.d/jenkins stop
ExecReload=/etc/rc.d/init.d/jenkins reload
PIDFILE=/var/run/jenkins.pid
#Environment="JENKINS_HOME=/var/lib/jenkins"
Environment="JAVA_OPTS=-Djava.awt.headless=true"
#Environment="JAVA_HOME=/etc/alternatives/java"

#User=jenkins

[Install]
WantedBy=multi-user.target

Thank you Mark
yes, we have setup httpskeystore file location in config file, sorry that error was before that.
we don’t see that error now.

The configuration is incorrect. You’re using a configuration that uses System V init to control the Jenkins service, when Jenkins has switched to use systemd to control the Jenkins service. Be sure that when you upgrade Jenkins, you use the same package manager to perform the upgrade as you used to perform the original installation.

Jenkins 2.332.1 switched Jenkins from using System V init to use systemd with its Linux package installers for Debian, Ubuntu, Red Hat, Alma, openSUSE, Rocky, and more. The LTS Upgrade Guide describes that transition and how to adapt your environment to the transition.

There is a blog post about it as well at

There is also a video introduction for RPM based distributions like Red Hat Enterprise Linux, Alma Linux, Rocky Linux, Oracle Linux, and Amazon Linux.

There is also a video introduction for deb based distributions like Debian and Ubuntu

1 Like

Hi Mark
Thank you so much for quick updates.
We had old pkg jenkins-2.164.3-1.1.noarch working on this, after linux patches, Jenkins service is not coming up.
then we removed old pkg and installed new pkg “jenkins-2.361-1.1.noarch” using rpm -i jenkins-2.361-1.1.noarch
we can’t do yum install, since not connected to outside.
Does 2.361 uses systemd?

Thank you.

Yes, 2.361.4 uses systemd.

I’m confident that since you installed with yum you need to upgrade with yum. If you did not install with yum or need to somehow create your own systemd service, without the help of the Jenkins rpm package, then you will need to spend the effort to learn how to define and configure a systemd service.

Find a way that will allow you to upgrade with yum.

1 Like

Can you not just download the rpm manually and transfer it over?

Yes, that is what we are doing it, but not sure if this is over writing Jenkins service as systemd instead of rc.d/init.d.

We are still not able to start this, does anybody provide support on this?
Thanks