• Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: Major Major
    • core
    • 1.509.2

      The logrotate script provided in the rpm and opensuse packages send an ALRM script to java after the log have been rotated. The result is that it entirely kills the java process which is not very nice.

      Way to reproduce:

      /bin/kill -s ALRM <pid of java process there>

      You could react on SIGUSR1 / SIGUSR2 maybe.

          [JENKINS-18874] logrotate script kills Jenkins (SIGALRM)

          Show full info about opensuse rpm, version, release, etc.

          Kanstantsin Shautsou added a comment - Show full info about opensuse rpm, version, release, etc.

          Kanstantsin Shautsou added a comment - - edited

          Also, how you detect that it was killed? I'm unable to reproduce.

          [root@~]# cat /var/run/jenkins.pid
          32216
          [root@~]# ps aufx| grep 32216
          jenkins  32216  1.7  8.6 3682732 427548 ?      Ssl  Aug17   2:26 /etc/alternatives/java -Dcom.sun.akuma.Daemon=daemonized -Djava.awt.headless=true -Xmx1500M -XX:MaxPermSize=256M -Dstapler.trace=true -DJENKINS_HOME=/var/lib/jenkins -jar /usr/lib/jenkins/jenkins.war --logfile=/var/log/jenkins/jenkins.log --webroot=/var/cache/jenkins/war --daemon --httpPort=8080 --ajp13Port=8009 --debug=5 --handlerCountMax=100 --handlerCountMaxIdle=20
          [root@~]# kill -s ALRM 32216
          [root@~]# ps aufx| grep 32216
          root     21344  0.0  0.0 109404   908 pts/0    S+   01:11   0:00          \_ grep --color=auto 32216
          jenkins  32216  1.7  8.6 3682732 427548 ?      Ssl  Aug17   2:26 /etc/alternatives/java -Dcom.sun.akuma.Daemon=daemonized -Djava.awt.headless=true -Xmx1500M -XX:MaxPermSize=256M -Dstapler.trace=true -DJENKINS_HOME=/var/lib/jenkins -jar /usr/lib/jenkins/jenkins.war --logfile=/var/log/jenkins/jenkins.log --webroot=/var/cache/jenkins/war --daemon --httpPort=8080 --ajp13Port=8009 --debug=5 --handlerCountMax=100 --handlerCountMaxIdle=20
          

          Kanstantsin Shautsou added a comment - - edited Also, how you detect that it was killed? I'm unable to reproduce. [root@~]# cat / var /run/jenkins.pid 32216 [root@~]# ps aufx| grep 32216 jenkins 32216 1.7 8.6 3682732 427548 ? Ssl Aug17 2:26 /etc/alternatives/java -Dcom.sun.akuma.Daemon=daemonized -Djava.awt.headless= true -Xmx1500M -XX:MaxPermSize=256M -Dstapler.trace= true -DJENKINS_HOME=/ var /lib/jenkins -jar /usr/lib/jenkins/jenkins.war --logfile=/ var /log/jenkins/jenkins.log --webroot=/ var /cache/jenkins/war --daemon --httpPort=8080 --ajp13Port=8009 --debug=5 --handlerCountMax=100 --handlerCountMaxIdle=20 [root@~]# kill -s ALRM 32216 [root@~]# ps aufx| grep 32216 root 21344 0.0 0.0 109404 908 pts/0 S+ 01:11 0:00 \_ grep --color=auto 32216 jenkins 32216 1.7 8.6 3682732 427548 ? Ssl Aug17 2:26 /etc/alternatives/java -Dcom.sun.akuma.Daemon=daemonized -Djava.awt.headless= true -Xmx1500M -XX:MaxPermSize=256M -Dstapler.trace= true -DJENKINS_HOME=/ var /lib/jenkins -jar /usr/lib/jenkins/jenkins.war --logfile=/ var /log/jenkins/jenkins.log --webroot=/ var /cache/jenkins/war --daemon --httpPort=8080 --ajp13Port=8009 --debug=5 --handlerCountMax=100 --handlerCountMaxIdle=20

          mark davison added a comment - - edited

          I am seeing this too on RHEl6.4 box (haven't tried on anything else) with jenkins 1.509.2 (LTS)

          Steps to recreate:

          1. sudo -u jenkins ./init.sh start
            Starting Jenkins service:
          2. cat ./jenkins.pid
            31877
          3. ps -ef | grep `cat ./jenkins.pid` | grep -v grep
            jenkins 31877 1 47 15:22 pts/0 00:00:16 /opt/LVjdk/current/bin/java -XX:MaxPermSize=512m -Xms1024m -Xmx1024m -verbose:gc -XX:+PrintGC -XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:/opt/jenkins/system/gc.log -jar /opt/jenkins/system/current/jenkins.war --httpPort=-1 --httpsPort=5443 --ajp13Port=-1 [TRUNCATED]
          4. kill -ALRM `cat ./jenkins.pid`
          5. ps -ef | grep `cat ./jenkins.pid` | grep -v grep
          6. sudo -u jenkins ./init.sh status
            dead but pid file exists

          --I also tried with kill -s ALRM `cat ./jenkins.pid`

          mark davison added a comment - - edited I am seeing this too on RHEl6.4 box (haven't tried on anything else) with jenkins 1.509.2 (LTS) Steps to recreate: sudo -u jenkins ./init.sh start Starting Jenkins service: cat ./jenkins.pid 31877 ps -ef | grep `cat ./jenkins.pid` | grep -v grep jenkins 31877 1 47 15:22 pts/0 00:00:16 /opt/LVjdk/current/bin/java -XX:MaxPermSize=512m -Xms1024m -Xmx1024m -verbose:gc -XX:+PrintGC -XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:/opt/jenkins/system/gc.log -jar /opt/jenkins/system/current/jenkins.war --httpPort=-1 --httpsPort=5443 --ajp13Port=-1 [TRUNCATED] kill -ALRM `cat ./jenkins.pid` ps -ef | grep `cat ./jenkins.pid` | grep -v grep sudo -u jenkins ./init.sh status dead but pid file exists --I also tried with kill -s ALRM `cat ./jenkins.pid`

          Oleg Nenashev added a comment -

          The default logrotate works correctly on 1.509.4 / RHEL6.4
          Probably, there could be an issue with java

          Oleg Nenashev added a comment - The default logrotate works correctly on 1.509.4 / RHEL6.4 Probably, there could be an issue with java

          Oleg Nenashev added a comment -

          Please re-open the issue if you experience it on newest versions

          Oleg Nenashev added a comment - Please re-open the issue if you experience it on newest versions

            integer Kanstantsin Shautsou
            hashar Antoine Musso
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: