Open dsefcik opened 8 years ago
not sure why it does not work. tried locally and i see the same issue.
I was having the same issue and I mapped the container log folder to a host volume. It has been working fine.
Here's my logrotate without squid3 -k rotate
:
#
# Logrotate fragment for squid3.
#
/var/log/squid3/*.log {
daily
compress
delaycompress
rotate 2
missingok
nocreate
}
Perhaps it would be safer to use copytruncate, given that we can't invoke the -k rotate command to tell squid to reopen the file?
copytruncate Truncate the original log file in place after creating a copy, instead of moving the old log file and optionally creating a new one, It can be used when some program can not be told to close its logfile and thus might continue writing (appending) to the previous log file forever. Note that there is a very small time slice between copying the file and truncating it, so some log- ging data might be lost. When this option is used, the create option will have no effect, as the old log file stays in place.
Otherwise, it may be possible to use kill -USR1 1
(where "1" is the main app PID number in docker) according to the squid.conf file
When squid's pid==1, ploblem is appeard. Use "docker run --init" etc.
root@88efec7f40cd:/# squid3 -k rotate squid: ERROR: No running copy
root@88efec7f40cd:/# cat /var/run/squid3.pid 1
Any ideas? TIA