From d9e8aac45816bfb09380888c2babbc7c4e29cedc Mon Sep 17 00:00:00 2001 From: William Petit Date: Thu, 30 Nov 2023 19:54:00 +0100 Subject: [PATCH] feat(packaging): rotate storage-server log files on alpine --- .goreleaser.yml | 7 +++++++ misc/packaging/openrc/storage-server.logrotate.conf | 9 +++++++++ misc/packaging/openrc/storage-server.openrc.sh | 2 +- 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 misc/packaging/openrc/storage-server.logrotate.conf diff --git a/.goreleaser.yml b/.goreleaser.yml index cef64e6..6256185 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -108,10 +108,17 @@ nfpms: file_info: mode: 0640 packager: apk + - src: misc/packaging/openrc/storage-server.logrotate.conf + dst: /etc/logrotate.d/storage-server + packager: apk - dst: /var/lib/storage-server type: dir file_info: mode: 0700 packager: apk + - dst: /var/log/storage-server + type: dir + file_info: + mode: 0700 scripts: postinstall: "misc/packaging/common/postinstall-storage-server.sh" \ No newline at end of file diff --git a/misc/packaging/openrc/storage-server.logrotate.conf b/misc/packaging/openrc/storage-server.logrotate.conf new file mode 100644 index 0000000..0eda295 --- /dev/null +++ b/misc/packaging/openrc/storage-server.logrotate.conf @@ -0,0 +1,9 @@ +/var/log/storage-server/storage-server.log { + missingok + sharedscripts + compress + rotate 7 + postrotate + /etc/init.d/storage-server restart + endscript +} \ No newline at end of file diff --git a/misc/packaging/openrc/storage-server.openrc.sh b/misc/packaging/openrc/storage-server.openrc.sh index b227186..1e34bf8 100644 --- a/misc/packaging/openrc/storage-server.openrc.sh +++ b/misc/packaging/openrc/storage-server.openrc.sh @@ -3,7 +3,7 @@ command="/usr/bin/storage-server" command_args="run" supervisor=supervise-daemon -output_log="/var/log/storage-server.log" +output_log="/var/log/storage-server/storage-server.log" error_log="$output_log" depend() {