Skip to content

Commit

Permalink
add logrotate to debian (#106)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #106

This diff adds logrotate config to the debian package to avoid log running out of space

Reviewed By: briancoutinho

Differential Revision:
D43178075

Privacy Context Container: L1137347

fbshipit-source-id: ac86be0e86667ebad526472fd90a971f1c37d8dd
  • Loading branch information
Hao Wang authored and facebook-github-bot committed Feb 13, 2023
1 parent 2073145 commit 2030ae6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions scripts/debian/make_deb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,16 @@ mkdir -p "$DEBDIR/usr/local/bin/"
mkdir -p "$DEBDIR/usr/lib/systemd/system/"
# control file goes here
mkdir -p "$DEBDIR/DEBIAN"
# logrotate config file goes here
mkdir -p "$DEBDIR/etc/logrotate.d/"

# Build the binaries
IFS=" " read -r -a generated_bins <<< "$(./scripts/build.sh | tail -n 1)"

cp -p "${generated_bins[@]}" "$DEBDIR/usr/local/bin"
cp -p scripts/dynolog.service "$DEBDIR/usr/lib/systemd/system"
cp -p scripts/pytorch/unitrace.py "$DEBDIR/usr/local/bin"
cp -p scripts/dynolog.conf "$DEBDIR/etc/logrotate.d"
perl -p -e "s/__VERSION__/$VERSION/" scripts/debian/control > "$DEBDIR/DEBIAN/control"

tree "$DEBDIR"
Expand Down
8 changes: 8 additions & 0 deletions scripts/dynolog.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/var/log/dynolog.log {
daily
rotate 7
size 10M
dateext
compress
delaycompress
}
1 change: 1 addition & 0 deletions scripts/rpm/make_rpm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ cp "${generated_bins[@]}" "dynolog-${VERSION}/"
# Add static files
cp "$SCRIPTS/dynolog.service" "dynolog-${VERSION}/"
cp "$SCRIPTS/pytorch/unitrace.py" "dynolog-${VERSION}/"
cp "$SCRIPTS/dynolog.conf" "dynolog-${VERSION}/"

# Compress sources
tar --create --file "dynolog-${VERSION}.tar.gz" "dynolog-${VERSION}"
Expand Down

0 comments on commit 2030ae6

Please sign in to comment.