From d7a48baf90f1d1bd965549bfe5fb9b32e484a358 Mon Sep 17 00:00:00 2001 From: rbxbx Date: Sun, 28 Nov 2021 23:08:04 -0500 Subject: [PATCH] Set up logrotate for icecast service --- icecast/Dockerfile | 4 +++- icecast/icecast.conf | 12 ++++++++++++ icecast/icecast.xml | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 icecast/icecast.conf diff --git a/icecast/Dockerfile b/icecast/Dockerfile index c952d21..4d8f616 100644 --- a/icecast/Dockerfile +++ b/icecast/Dockerfile @@ -7,7 +7,7 @@ ENV LANG en_US.UTF-8 ENV DEBIAN_FRONTEND noninteractive RUN apt-get update && apt-get upgrade -y -RUN apt-get install -y build-essential wget libxslt1-dev libvorbis-dev git +RUN apt-get install -y build-essential wget libxslt1-dev libvorbis-dev git logrotate RUN apt-get clean RUN git clone https://github.com/karlheyes/icecast-kh.git @@ -18,6 +18,8 @@ ADD icecast.xml /icecast.xml RUN useradd --create-home -s /bin/bash icecast RUN chown icecast:users /icecast.xml +ADD icecast.conf /etc/logrotate.d/icecast.conf + RUN mkdir -p /usr/local/share/icecast/ RUN mkdir -p /usr/local/share/icecast/logs RUN mkdir -p /usr/local/share/icecast/web diff --git a/icecast/icecast.conf b/icecast/icecast.conf new file mode 100644 index 0000000..af67e8a --- /dev/null +++ b/icecast/icecast.conf @@ -0,0 +1,12 @@ +/usr/local/share/icecast/logs/*.log { + daily + rotate 4 + size 50M + compress + delaycompress + sharedscripts + notifempty + postrotate + kill -HUP `cat /usr/local/share/icecast/icecast.pid` + endscript +} diff --git a/icecast/icecast.xml b/icecast/icecast.xml index ea8cfa3..a35af58 100644 --- a/icecast/icecast.xml +++ b/icecast/icecast.xml @@ -167,7 +167,7 @@ /usr/local/share/icecast/logs /usr/local/share/icecast/web /usr/local/share/icecast/admin - + /usr/local/share/icecast/icecast.pid