Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: rotate jmwalletd logs #72

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions standalone/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ RUN addgroup --system tor \
&& apt-get update \
&& apt-get install -qq --no-install-recommends --no-install-suggests -y \
# image dependencies
tini iproute2 procps vim \
tini iproute2 procps vim cron \
# servers dependencies (see `install.sh`)
build-essential automake pkg-config libtool libltdl-dev python3-dev python3-setuptools python3-pip \
# tor
Expand Down Expand Up @@ -129,12 +129,15 @@ RUN apt-get remove --purge --auto-remove -y gnupg python3-pip apt-transport-http
&& rm --force /var/log/dpkg.log

COPY default.cfg ${DEFAULT_CONFIG}
COPY dinit-conf/* /etc/dinit.d/
COPY .bashrc /root/.bashrc
COPY --chown=tor:tor torrc /etc/tor/torrc

COPY nginx/snippets/proxy-params.conf /etc/nginx/snippets/proxy-params.conf
COPY nginx/default.conf /etc/nginx/conf.d/default.conf
COPY usr/local/bin/* /usr/local/bin/
RUN chmod +x -R /usr/local/bin

COPY etc/cron.d/ /etc/cron.d/
COPY etc/dinit.d/ /etc/dinit.d/
COPY etc/nginx/ /etc/nginx/

COPY jam-entrypoint.sh /
RUN chmod +x /jam-entrypoint.sh
Expand Down
2 changes: 2 additions & 0 deletions standalone/etc/cron.d/jam-savelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# rotate every second day
0 0 */2 * * root /usr/local/bin/jam-savelog.sh
1 change: 1 addition & 0 deletions standalone/dinit-conf/boot → standalone/etc/dinit.d/boot
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
type = internal

waits-for = cron
waits-for = nginx
waits-for = tor
waits-for = jmwalletd
Expand Down
5 changes: 5 additions & 0 deletions standalone/etc/dinit.d/cron
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
type = process
command = /usr/sbin/cron -f
working-dir = /root
restart = true
logfile = /var/log/cron.log
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 5 additions & 0 deletions standalone/usr/local/bin/jam-savelog.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
set -e

# for more info see: https://www.unix.com/man-page/Linux/8/savelog/
savelog -t -p -l -n -c 5 /var/log/jam/jmwalletd_stdout.log