Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automated cherry pick of #29139 #29157

Conversation

bprashanth
Copy link
Contributor

Cherry pick of #29139 on release-1.3.

we need to add the dateformat option so that the logrotate
can create unique logfiles for each rotation. Without this,
we logrotation is skipped with message like (generated in
verbose mode of logrotate):

rotating log /var/log/rotate-test.log, log->rotateCount is 5
dateext suffix '-20160718'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
destination /var/log/rotate-test2.log-20160718.gz already exists, skipping rotation

Tested as follows:

  # config in '/etc/logrotate.d/rotate-test':
  /var/log/rotate-test.log {
    rotate 5
    copytruncate
    missingok
    notifempty
    compress
    maxsize 100M
    daily
    dateext
    dateformat -%Y%m%d-%s
    create 0644 root root
  }

  # create 150Mb of /var/log/rotate-test.log
  $ dd if=/dev/zero of=/var/log/rotate-test.log bs=1048576 count=150 conv=notrunc oflag=append

  # run logrotate
  $ /usr/sbin/logrotate -v /etc/logrotate.conf
  ...
  rotating pattern: /var/log/rotate-test.log  after 1 days (5 rotations)
  empty log files are not rotated, log files >= 104857600 are rotated earlier, old logs are removed
  considering log /var/log/rotate-test.log
    log needs rotating
  rotating log /var/log/rotate-test.log, log->rotateCount is 5
  Converted ' -%Y%m%d-%s' -> '-%Y%m%d-%s'
  dateext suffix '-20160718-1468875268'
  glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
  copying /var/log/rotate-test.log to /var/log/rotate-test.log-20160718-1468875268
  truncating /var/log/rotate-test.log
  compressing log with: /bin/gzip

  Repeating 'dd' and 'logrotate' commands now generate logfiles correctly.
@bprashanth bprashanth added the release-note-none Denotes a PR that doesn't merit a release note. label Jul 19, 2016
@bprashanth bprashanth added this to the v1.3 milestone Jul 19, 2016
@k8s-github-robot k8s-github-robot added cherry-pick-approved Indicates a cherry-pick PR into a release branch has been approved by the release branch manager. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jul 19, 2016
@adityakali
Copy link
Contributor

LGTM. Thanks!

@fabioy fabioy added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 19, 2016
@fabioy
Copy link
Contributor

fabioy commented Jul 19, 2016

@bprashanth Could you rebase this? Thanks.

@fabioy
Copy link
Contributor

fabioy commented Jul 19, 2016

@bprashanth NVM about the rebase -- misread the checks. Thanks.

@zmerlynn
Copy link
Member

@k8s-bot e2e test this, issue #IGNORE

@k8s-github-robot
Copy link

@zmerlynn
You must link to the test flake issue which caused you to request this manual re-test.
Re-test requests should be in the form of: k8s-bot test this issue: #<number>
Here is the list of open test flakes.

@k8s-github-robot k8s-github-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 19, 2016
@fabioy fabioy added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 19, 2016
@k8s-bot
Copy link

k8s-bot commented Jul 19, 2016

GCE e2e build/test passed for commit 4a1d8f5.

@zmerlynn
Copy link
Member

Adding retest-not-required after SQ reboot.

@k8s-github-robot
Copy link

Automatic merge from submit-queue

@k8s-github-robot k8s-github-robot merged commit 76000da into kubernetes:release-1.3 Jul 19, 2016
shyamjvs pushed a commit to shyamjvs/kubernetes that referenced this pull request Dec 1, 2016
…pick-of-#29139-upstream-release-1.3

Automatic merge from submit-queue

Automated cherry pick of kubernetes#29139

Cherry pick of kubernetes#29139 on release-1.3.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-pick-approved Indicates a cherry-pick PR into a release branch has been approved by the release branch manager. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants