Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-5784

Usage of kill in logrotate script is non-portable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Component/s: other
    • Labels:
      None

      Description

      The logrotate script uses

      kill -SIGALRM `cat /var/run/hudson.pid`

      which works fine for the bash builtin, but fails for /bin/kill, which only accepts

      usage: kill [ -s signal | -p ] [ -a ] pid ...
             kill -l [ signal ]

      on CentOS 5.

      Using kill -s SIGALRM would make both variants happy and increase portability.

        Activity

        Hide
        guyshaanan Guy Shaanan added a comment -

        Fixed for me.
        Our Jenkins process was running with user "root".
        The log rotate script had "-user jenkins" inside it. So changed to "-user root" and restarted Jenkins.
        Now everything works as expected.
        Thanks @Oleg Nenashev for your help locating all the different configuration files.

        Show
        guyshaanan Guy Shaanan added a comment - Fixed for me. Our Jenkins process was running with user "root". The log rotate script had "-user jenkins" inside it. So changed to "-user root" and restarted Jenkins. Now everything works as expected. Thanks @Oleg Nenashev for your help locating all the different configuration files.
        Hide
        guyshaanan Guy Shaanan added a comment -

        Just make sure the user running Jenkins and the user found in the /etc/logrotate.d/jenkins are the same user.

        Show
        guyshaanan Guy Shaanan added a comment - Just make sure the user running Jenkins and the user found in the /etc/logrotate.d/jenkins are the same user.
        Hide
        scm_issue_link SCM/JIRA link daemon added a comment -

        Code changed in jenkins
        User: Kohsuke Kawaguchi
        Path:
        SOURCES/jenkins.logrotate
        http://jenkins-ci.org/commit/packaging/3a80ebec8548f4c8c1093aff7003043effb10aac
        Log:
        [FIXED JENKINS-5784] logrotate script for RPM/openSUSE bug fix

        Originally-From: jenkins-ci.org/commit/core/9c01038ab5cbd1a92e0a172a1834028b7862099f

        Show
        scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Kohsuke Kawaguchi Path: SOURCES/jenkins.logrotate http://jenkins-ci.org/commit/packaging/3a80ebec8548f4c8c1093aff7003043effb10aac Log: [FIXED JENKINS-5784] logrotate script for RPM/openSUSE bug fix Originally-From: jenkins-ci.org/commit/core/9c01038ab5cbd1a92e0a172a1834028b7862099f
        Hide
        scm_issue_link SCM/JIRA link daemon added a comment -

        Code changed in jenkins
        User: Kohsuke Kawaguchi
        Path:
        SOURCES/jenkins.logrotate
        http://jenkins-ci.org/commit/packaging/f714817bff7fd132d018d4e9690064498c213eeb
        Log:
        [FIXED JENKINS-5784] logrotate script for RPM/openSUSE bug fix

        Originally-From: jenkins-ci.org/commit/core/9c01038ab5cbd1a92e0a172a1834028b7862099f

        Show
        scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Kohsuke Kawaguchi Path: SOURCES/jenkins.logrotate http://jenkins-ci.org/commit/packaging/f714817bff7fd132d018d4e9690064498c213eeb Log: [FIXED JENKINS-5784] logrotate script for RPM/openSUSE bug fix Originally-From: jenkins-ci.org/commit/core/9c01038ab5cbd1a92e0a172a1834028b7862099f
        Hide
        scm_issue_link SCM/JIRA link daemon added a comment -

        Code changed in jenkins
        User: Kohsuke Kawaguchi
        Path:
        SOURCES/jenkins.logrotate
        http://jenkins-ci.org/commit/packaging/3027ec69285fb765650089b4fb6863906f67ed83
        Log:
        [FIXED JENKINS-5784]

        Applied the change from Olav Reinert.

        Originally-From: jenkins-ci.org/commit/core/8fb2f5162e499b5c0c4dc8f88af761b7c490bc38

        Show
        scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Kohsuke Kawaguchi Path: SOURCES/jenkins.logrotate http://jenkins-ci.org/commit/packaging/3027ec69285fb765650089b4fb6863906f67ed83 Log: [FIXED JENKINS-5784] Applied the change from Olav Reinert. Originally-From: jenkins-ci.org/commit/core/8fb2f5162e499b5c0c4dc8f88af761b7c490bc38

          People

          • Assignee:
            Unassigned
            Reporter:
            rombert rombert
          • Votes:
            6 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: