> 
> 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.
> 

 All of my KVM VMs are definitely running now.  I think
It came from the 'copytruncate' by "logadm -c". Once rotate-kvm-logs.sh ends,
all the non-empty vm.log files are rotating into "/var/log/sdc/upload/qemu-xxx".
And if rotate-kvm-log.sh runs again, no new entry will be generated.

 
> 
> 
>       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/64998c0b5a7c33287eb7dd118fef
> 4aea42e5a6f3/src/vm/sbin/vmadmd.js#L625
> <https://github.com/joyent/smartos-live/blob/64998c0b5a7c33287eb7dd118fe
> f4aea42e5a6f3/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.

From my side, the intuitive and direct way is removing the entry by "vmadm 
destroy".
We can also add the similar cose in vmadmd source.


Thanks.

Fred


-------------------------------------------
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

Reply via email to