sameersbn / docker-squid

Dockerfile to create a Docker container image for Squid proxy server
MIT License
822 stars 412 forks source link

Logrotate ERROR: No running copy #8

Open dsefcik opened 8 years ago

dsefcik commented 8 years ago

root@88efec7f40cd:/# squid3 -k rotate squid: ERROR: No running copy

root@88efec7f40cd:/# cat /var/run/squid3.pid 1

Any ideas? TIA

sameersbn commented 8 years ago

not sure why it does not work. tried locally and i see the same issue.

hgontijo commented 7 years ago

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
}
stefcl commented 7 years ago

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

taksekine commented 6 years ago

When squid's pid==1, ploblem is appeard. Use "docker run --init" etc.