Page MenuHomePhabricator

/etc/init.d/jenkins script provided by Debian doesn't work properly
Closed, ResolvedPublic

Description

The Jenkins init script provided with the Debian package does not properly track the pidfile. It writes in jenkins.pid the pid of daemon instead of the spawned java process, that cause the restart/reload/stop targets to not work properly.

To make it worth, the init script provided for openSUSE/rpm and Debian are all different.

Details

Reference
bz51817

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 1:59 AM
bzimport set Reference to bz51817.
bzimport added a subscriber: Unknown Object (MLST).

Is that worth to upstream to http://bugs.debian.org ?
If so, which exact Jenkins version does this refer to?

$ cat /var/run/jenkins/jenkins.pid
32018
$

Pid 32018 is /usr/bin/daemon with --pidfile=/var/run/jenkins/jenkins.pid

Its children was pid 32020 which is the java process.

When using the init script 'stop' command, it send a signal to daemon and java process belong to jenkins:

killall -u jenkins java daemon

jenkins log:

Sep 24, 2013 7:46:23 AM winstone.Logger logInternal
INFO: JVM is terminating. Shutting down Winstone
Exception in thread "Channel reader thread: integration-debian-builder" java.lang.NullPointerException
at hudson.model.Computer.getNode(Computer.java:465)
at hudson.slaves.SlaveComputer.getNode(SlaveComputer.java:176)
at hudson.plugins.sshslaves.SSHLauncher.afterDisconnect(SSHLauncher.java:963)
at hudson.slaves.SlaveComputer$2.onClosed(SlaveComputer.java:419)
at hudson.remoting.Channel.terminate(Channel.java:749)
at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:69)

But both daemon and java are still running after and the pidfile got deleted.

Have to kill -9 the process :(

Krinkle renamed this task from Jenkins: init script is crap to /etc/init.d/jenkins script provided by Debian doesn't work properly.Apr 13 2015, 3:41 PM
Krinkle updated the task description. (Show Details)
Krinkle added projects: Upstream, Jenkins.
Krinkle set Security to None.
Krinkle moved this task from Untriaged to Backlog on the Continuous-Integration-Infrastructure board.
Krinkle removed a subscriber: Unknown Object (MLST).

Removed comment that was a different issue. Now tracked at T98976

hashar lowered the priority of this task from Low to Lowest.Jun 9 2015, 7:59 PM
hashar moved this task from Backlog to Stalled on the Jenkins board.
hashar claimed this task.

We have moved to Debian Jessie and the init script is now managed by systemd. So I believe it is no more an issue and systemd would kill the java process for us.

For the record, we are now running Jenkins with systemd. So this definitely no more applies.