Skip to content

[JENKINS-67724] Debian package fails to start when JAVA_ARGS contains spaces #694

Closed

Description

@jenkins-infra-bot

If /etc/default/jenkins contains something like

JAVA_ARGS="-Djava.awt.headless=true -Dhudson.model.DirectoryBrowserSupport.CSP=\"sandbox; default-src 'self';\""

then as of 2.333 startup will fail with:

$ cat /var/log/jenkins/jenkins.log 
Error: Could not find or load main class 'self';"
Caused by: java.lang.ClassNotFoundException: 'self';"


Originally reported by basil, imported from: Debian package fails to start when JAVA_ARGS contains spaces
  • assignee: basil
  • status: Resolved
  • priority: Major
  • component(s): packaging
  • label(s): regression
  • resolution: Fixed
  • resolved: 2022-02-02T18:59:59+00:00
  • votes: 0
  • watchers: 1
  • imported: 2025-11-26
Raw content of original issue

If /etc/default/jenkins contains something like

JAVA_ARGS="-Djava.awt.headless=true -Dhudson.model.DirectoryBrowserSupport.CSP=\"sandbox; default-src 'self';\""

then as of 2.333 startup will fail with:

$ cat /var/log/jenkins/jenkins.log 
Error: Could not find or load main class 'self';"
Caused by: java.lang.ClassNotFoundException: 'self';"

Activity

  1. jenkins-infra-bot commented on Feb 2, 2022

    @jenkins-infra-bot
    Author
  2. jenkins-infra-bot commented on Feb 2, 2022

    @jenkins-infra-bot
    Author
    basil:
    • Original comment link
    • Raw content of original comment:

      This will be fixed in 2.334. Affected users can work around the issue by applying this patch to /etc/init.d/jenkins:

      diff --git a/deb/build/debian/jenkins.init b/deb/build/debian/jenkins.init
      index fa1aa49..5a94204 100644
      --- a/deb/build/debian/jenkins.init
      +++ b/deb/build/debian/jenkins.init
      @@ -130,6 +130,7 @@ do_start_cmd_override() {
                      LOGNAME="${JENKINS_USER}" \
                      USERNAME="${JENKINS_USER}" \
                      PWD="${JENKINS_HOME}" \
      +               eval \
                      start-stop-daemon \
                      --start \
                      --quiet \
      

    This will be fixed in 2.334. Affected users can work around the issue by applying this patch to /etc/init.d/jenkins:

    diff --git a/deb/build/debian/jenkins.init b/deb/build/debian/jenkins.init
    index fa1aa49..5a94204 100644
    --- a/deb/build/debian/jenkins.init
    +++ b/deb/build/debian/jenkins.init
    @@ -130,6 +130,7 @@ do_start_cmd_override() {
    LOGNAME="${JENKINS_USER}" \
    USERNAME="${JENKINS_USER}" \
    PWD="${JENKINS_HOME}" \
    +       eval \
    start-stop-daemon \
    --start \
    --quiet \
    
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions