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 Apr 3, 2019
1 parent 8df76dd commit e9dafbf
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 4 deletions.
3 changes: 3 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,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
12 changes: 8 additions & 4 deletions extras/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,15 @@ CLEANFILES = *~
install-data-local:
$(MKDIR_P) $(DESTDIR)$(GLUSTER_BLOCKD_LIBEXECDIR); \
$(INSTALL_DATA) -m 755 $(top_srcdir)/extras/wait-for-bricks.sh \
$(DESTDIR)$(GLUSTER_BLOCKD_LIBEXECDIR)/wait-for-bricks.sh; \
$(DESTDIR)$(GLUSTER_BLOCKD_LIBEXECDIR)/wait-for-bricks.sh; \
$(INSTALL_DATA) -m 755 $(top_srcdir)/extras/upgrade_activities.sh \
$(DESTDIR)$(GLUSTER_BLOCKD_LIBEXECDIR)/upgrade_activities.sh
$(DESTDIR)$(GLUSTER_BLOCKD_LIBEXECDIR)/upgrade_activities.sh; \
$(MKDIR_P) $(DESTDIR)$(GLUSTER_BLOCKD_LOGROTATEDIR); \
$(INSTALL_DATA) -m 644 gluster-block.logrotate \
$(DESTDIR)$(GLUSTER_BLOCKD_LOGROTATEDIR)/gluster-block;

uninstall-local:
rm -f $(DESTDIR)$(GLUSTER_BLOCKD_LIBEXECDIR)/wait-for-bricks.sh \
$(DESTDIR)$(GLUSTER_BLOCKD_LIBEXECDIR)/upgrade_activities.sh \
$(DESTDIR)$(GLUSTER_BLOCKD_WORKDIR)/gb_upgrade.status;
$(DESTDIR)$(GLUSTER_BLOCKD_LIBEXECDIR)/upgrade_activities.sh \
$(DESTDIR)$(GLUSTER_BLOCKD_WORKDIR)/gb_upgrade.status \
$(DESTDIR)$(GLUSTER_BLOCKD_LOGROTATEDIR)/gluster-block;
18 changes: 18 additions & 0 deletions extras/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
}
1 change: 1 addition & 0 deletions gluster-block.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,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

0 comments on commit e9dafbf

Please sign in to comment.