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

Re: [atomic-devel] cron job for logrotate on containers



On Wed, Dec 17, 2014 at 03:27:11PM -0500, SGhosh wrote:
> On 12/17/2014 10:39 AM, Daniel J Walsh wrote:
> >On 12/17/2014 10:32 AM, Lokesh Mandvekar wrote:
> >>On Tue, Dec 16, 2014 at 12:15:24PM -0500, Andy Goldstein wrote:
> >>>On Dec 16, 2014, at 12:12 PM, Colin Walters <walters verbum org> wrote:
> >>>
> >>>>On Tue, Dec 16, 2014, at 11:10 AM, Lokesh Mandvekar wrote:
> >>>>>I have a script which would run logrotate on all running docker containers.
> >>>>>Plan is to have this installed via the docker rpm into /etc/cron.daily. Posting here
> >>>>>for further discussion as per Colin's suggestion before I include it in any rpms.
> >>>>>
> >>>>>---
> >>>>>#!/bin/sh
> >>>>>
> >>>>>for id in $(docker ps -q); do
> >>>>>    docker exec $id logrotate -s /var/log/logstatus /etc/logrotate.conf >/dev/null 2>&1
> >>>>>done
> >>>>>exit 0
> >>>>I don't like that this presumes I have logrotate inside my containers.  If I have
> >>>>configured my containers to be microservices (potentially using a custom "thin"
> >>>>base instead of the present "fat" base) using remote logging, then I don't need this.
> >>>>
> >>>>I get that this is trying to address a real problem, but I feel like with this
> >>>>we're encouraging people to do the wrong thing.
> >>>>
> >>>>I also think cron is just a hack =/  There are race conditions here if
> >>>>the container exits before the exec runs, and I know we ignore that
> >>>>with >/dev/null, but still.
> >>>>
> >>>>This seems like something to add to *documentation* around container
> >>>>logging as an option if you're using "containers as VMs" model.  But
> >>>>not something to turn on by default for every user of the Docker RPM.
> >>>>
> >>>+1, this should be optional and disabled by default
> >>We could add this to a 'docker-logrotate' optional subpackage along with a
> >>doc describing issues. Would that work for all?
> >>
> >I think this is the easiest method, then users who want logrotate can
> >simply install the package.
> >
> 
> Need to include in Atomic host - but disable by default
> 

Built for rawhide here:
http://koji.fedoraproject.org/koji/taskinfo?taskID=8416782

docker-io main rpm:
https://kojipkgs.fedoraproject.org//work/tasks/6782/8416782/docker-io-1.4.1-1.fc22.x86_64.rpm

docker-io-logrotate is a separate rpm:
https://kojipkgs.fedoraproject.org//work/tasks/6782/8416782/docker-io-logrotate-1.4.1-1.fc22.x86_64.rpm
The -logrotate rpm also installs this doc:
http://pkgs.fedoraproject.org/cgit/docker-io.git/tree/README.container-logrotate

Let me know if any of this needs to be changed, I'll build it for all other branches and
rhel/centos in a bit.
-- 
Lokesh
Freenode, OFTC: lsm5
GPG: 0xC7C3A0DD

Attachment: pgpnXwFaaGxcA.pgp
Description: PGP signature


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