> > > The reason why I haven't got the concerning entry is lines from #36 to > #38 of the source (https://github.com/joyent/smartos-live/blob/ > 64998c0b5a7c33287eb7dd118fef4aea42e5a6f3/src/vm/sbin/rotate- > kvm-logs.sh#L36) -- > > " > if [[ ! -s ${logfile} ]]; then > # file doesn't exist or is empty > return; > fi > ". > > Because all my ${logfile} has size of 0, rotate_log() returns. > And the script won't go to lines from #72 to #78( > https://github.com/joyent/smartos-live/blob/64998c0b5a7c33287eb7dd118fef4a > ea42e5a6f3/src/vm/sbin/rotate-kvm-logs.sh#L72) -- > > Hi Fred,
That'll only be true if the KVM VM is never booted. Whenever it is booted, the file will be non-empty until it is rotated since there are always messages written to the log when a KVM VM boots. > Plus, I also notice that there is logadm invocation during "vmadm create" > in lines from #625 to #641 of source (https://github.com/joyent/ > smartos-live/blob/64998c0b5a7c33287eb7dd118fef4a > ea42e5a6f3/src/vm/sbin/vmadmd.js#L625) -- > > You're right. I had forgotten about this code in vmadmd. I had looked only at vmadm. I don't see how this changes anything though. Because it's still the rotate-kvm-logs.sh that it's calling to do the rotation. The same thing would have happened at the first cron execution after this if vmadmd didn't do it. Since it seems that fixing the bug in logadm that causes this problem might be a while still in coming, I will look into the prospect of adding a workaround that runs: logadm -r /zones/<uuid>/root/tmp/vm.log when deleting a KVM VM, or in the rotate-kvm-logs.sh itself when it sees a VM no longer exists. I've filed https://smartos.org/bugview/OS-6053 to look into this. Thanks, Josh ------------------------------------------- smartos-discuss Archives: https://www.listbox.com/member/archive/184463/=now RSS Feed: https://www.listbox.com/member/archive/rss/184463/25769125-55cfbc00 Modify Your Subscription: https://www.listbox.com/member/?member_id=25769125&id_secret=25769125-7688e9fb Powered by Listbox: http://www.listbox.com