kubernetes/cluster/gce/gci
k8s-merge-robot 8b16c75ba5 Merge pull request #29139 from adityakali/logrotate.1
Automatic merge from submit-queue

fix logrotate config (again)

we need to add the dateformat option so that the logrotate
can create unique logfiles for each rotation. Without this,
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.

#27754 
@bprashanth can you please review?
2016-07-18 18:20:41 -07:00
..
configure-helper.sh Merge pull request #29139 from adityakali/logrotate.1 2016-07-18 18:20:41 -07:00
configure.sh bump cni version 2016-07-11 14:33:01 -07:00
health-monitor.sh Remove "All rights reserved" from all the headers. 2016-06-29 17:47:36 -07:00
helper.sh Splitting OS_DISTRIBUTION into NODE_OS_DISTRIBUTION and 2016-07-15 12:02:31 -07:00
master-helper.sh Splitting OS_DISTRIBUTION into NODE_OS_DISTRIBUTION and 2016-07-15 12:02:31 -07:00
master.yaml add logrotate service and configuration for GCI 2016-06-14 19:01:58 -07:00
node-helper.sh Splitting OS_DISTRIBUTION into NODE_OS_DISTRIBUTION and 2016-07-15 12:02:31 -07:00
node.yaml add logrotate service and configuration for GCI 2016-06-14 19:01:58 -07:00
README.md Revert "Revert "Add support for running GCI on the GCE cloud provider"" 2016-05-23 00:52:08 -07:00

Google Container-VM Image (GCI)

GCI is a container-optimized OS image for the Google Cloud Platform (GCP). We built GCI primarily for running Google services on GCP. Unlike the open preview version of container-vm, Google Container-VM Image is based on the open source Chromium OS project, allowing us greater control over the build management, security compliance, and customizations for GCP.

Analytics