Skip to content

Commit

Permalink
gluster-block: add logrotate support
Browse files Browse the repository at this point in the history
Signed-off-by: Xiubo Li <[email protected]>
  • Loading branch information
lxbsz committed Mar 24, 2019
1 parent 9afb012 commit fb56ddc
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 2 deletions.
3 changes: 3 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ fi
GLUSTER_BLOCKD_LIBEXECDIR="$(eval echo ${libexecdir}/gluster-block)"
AC_SUBST(GLUSTER_BLOCKD_LIBEXECDIR)

GLUSTER_BLOCKD_LOGROTATEDIR="$(eval echo /etc/logrotate.d)"
AC_SUBST(GLUSTER_BLOCKD_LOGROTATEDIR)

# Checks for typedefs, structures, and compiler characteristics.
AC_CHECK_HEADER_STDBOOL
AC_TYPE_SIZE_T
Expand Down
1 change: 1 addition & 0 deletions gluster-block.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ rm -rf ${RPM_BUILD_ROOT}
%attr(0755,-,-) %{_initddir}/gluster-blockd
%endif
%config(noreplace) %{_sysconfdir}/sysconfig/gluster-blockd
%config(noreplace) %{_sysconfdir}/logrotate.d/gluster-block
%dir %attr(0755,-,-) %{_libexecdir}/gluster-block
%attr(0755,-,-) %{_libexecdir}/gluster-block/wait-for-bricks.sh
%attr(0755,-,-) %{_libexecdir}/gluster-block/upgrade_activities.sh
Expand Down
8 changes: 6 additions & 2 deletions systemd/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ endif
install-data-local:
$(MKDIR_P) $(DESTDIR)${sysconfigdir}; \
$(INSTALL_DATA) gluster-blockd.sysconfig \
$(DESTDIR)${sysconfigdir}/gluster-blockd;
$(DESTDIR)${sysconfigdir}/gluster-blockd; \
$(MKDIR_P) $(DESTDIR)$(GLUSTER_BLOCKD_LOGROTATEDIR);\
$(INSTALL_DATA) -m 644 gluster-block.logrotate \
$(DESTDIR)$(GLUSTER_BLOCKD_LOGROTATEDIR)/gluster-block;

uninstall-local:
rm -f $(DESTDIR)${sysconfigdir}/gluster-blockd
rm -f $(DESTDIR)${sysconfigdir}/gluster-blockd \
$(DESTDIR)$(GLUSTER_BLOCKD_LOGROTATEDIR)/gluster-block
18 changes: 18 additions & 0 deletions systemd/gluster-block.logrotate
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Rotate all the gluster-block logs
/var/log/gluster-block/*.log {
sharedscripts
weekly
maxsize 10M
minsize 100k

# 6 months of logs are good enough
rotate 26

missingok
compress
delaycompress
notifempty
postrotate
killall -q -s 1 gluster-blockd > /dev/null 2>&1 || true
endscript
}

0 comments on commit fb56ddc

Please sign in to comment.