rotatelogs behavior in kubernetes pod

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




I have a kubernetes pod that is running a command of the form:

sh -c 'python foo.py 2>&1 | rotatelogs -e -L log -n 3 logfile 1G'

This works great. However, when the pod is deleted (e.g. kubectl delete pod foo), kube restarts the pod.

Upon restart the log and logfile are empty!!! Instead, the contents should have been retained.

I've tested with:

sh -c '(cat 'foo';sleep 10000) 2>&1 | rotatelogs -e -L log -n 3 logfile 1G' &

followed by kill -HUP, kill, kill -9 etc of the process and no truncation/deletion of the newest log file occurs.

Meanwhile, tests like:

echo 'foo' | rotatelogs -v -L log -n 3 logfile 3B
echo 'foo' | rotatelogs -v -L log -n 3 logfile 3B
echo 'foo' | rotatelogs -v -L log -n 3 logfile 3B

do *not* cause the file to rotate once it's 3B+ long.

... in brief, rotatelogs (at least with -n) seems utterly broken???

A.



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx




[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux