[
https://issues.apache.org/jira/browse/CLOUDSTACK-9155?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15054910#comment-15054910
]
ASF GitHub Bot commented on CLOUDSTACK-9155:
--------------------------------------------
GitHub user remibergsma opened a pull request:
https://github.com/apache/cloudstack/pull/1235
CLOUDSTACK-9155 make sure logrotate is effective for cloud.log
Many processes on the VRs log to cloud.log. When log rotate kicks in, the
file is rotated but the scripts still write to the old inode (cloud.log.1 after
rotate). Tis quickly fills up the tiny log partition.
Using 'copytruncate' is a small tradeoff, there is a slight change of
missing a log entry, but in the old situation nothing ended up in cloud.log
after rotate (except for stuff that was (re)started) so I think this is the
best solution until we properly rewrite the script to either use their own
script or syslog.
More details: https://issues.apache.org/jira/browse/CLOUDSTACK-9155
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/remibergsma/cloudstack
fix-passwd-server-logging
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/cloudstack/pull/1235.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #1235
----
commit 0742535e13c51372c63b045181d6a20198fb397e
Author: Remi Bergsma <[email protected]>
Date: 2015-12-13T10:53:45Z
CLOUDSTACK-9155 make sure logrotate is effective
Many processes on the VRs log to cloud.log. When logrotate
kicks in, the file is rotated but the scripts still write
to the old inode (cloud.log.1 after rotate). Tis quickly
fills up the tiny log partition.
Using 'copytruncate' is a tradeoff, there is a slight
change of missing a log entry, but in the old situation
we were missing all of them after logrotate.
----
> Log rotate of cloud.log doesn't work properly
> ---------------------------------------------
>
> Key: CLOUDSTACK-9155
> URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9155
> Project: CloudStack
> Issue Type: Bug
> Security Level: Public(Anyone can view this level - this is the
> default.)
> Components: Virtual Router
> Affects Versions: 4.6.0, 4.7.0, 4.6.1, 4.6.2
> Reporter: Remi Bergsma
> Priority: Critical
>
> Many processes log into the cloud.log file. When log rotate is called, many
> of them keep logging to the old inode and fill up the disk like that.
> These have cloud.log open:
> ```
> root@r-1023-VM:~# lsof| grep cloud | awk {'print $1'} | sort -u
> apache2
> conntrack
> keepalive
> logger
> passwd_se
> _plutoloa
> _plutorun
> python
> xl2tpd
> ```
> Current log rotate config:
> ```
> /var/log/cloud.log {
> rotate 4
> daily
> size 10M
> missingok
> notifempty
> compress
> delaycompress
> }
> ```
> After log rotate this happens:
> ```
> root@r-996-VM:/etc# lsof | grep cloud.log.1
> _plutorun 767 root 3w REG 202,10 26054919
> 71 /var/log/cloud.log.1
> logger 768 root 3w REG 202,10 26054919
> 71 /var/log/cloud.log.1
> _plutorun 772 root 3w REG 202,10 26054919
> 71 /var/log/cloud.log.1
> _plutoloa 773 root 3w REG 202,10 26054919
> 71 /var/log/cloud.log.1
> xl2tpd 843 root 3w REG 202,10 26054919
> 71 /var/log/cloud.log.1
> python 854 root 3w REG 202,10 26054919
> 71 /var/log/cloud.log.1
> passwd_se 860 root 1w REG 202,10 26054919
> 71 /var/log/cloud.log.1
> passwd_se 860 root 2w REG 202,10 26054919
> 71 /var/log/cloud.log.1
> passwd_se 860 root 3w REG 202,10 26054919
> 71 /var/log/cloud.log.1
> python 863 root 3w REG 202,10 26054919
> 71 /var/log/cloud.log.1
> passwd_se 869 root 1w REG 202,10 26054919
> 71 /var/log/cloud.log.1
> passwd_se 869 root 2w REG 202,10 26054919
> 71 /var/log/cloud.log.1
> passwd_se 869 root 3w REG 202,10 26054919
> 71 /var/log/cloud.log.1
> python 871 root 3w REG 202,10 26054919
> 71 /var/log/cloud.log.1
> ```
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)