mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH] logrotate: Create directory for state file
@ 2018-02-06 13:29 Alexander Dahl
  0 siblings, 0 replies; only message in thread
From: Alexander Dahl @ 2018-02-06 13:29 UTC (permalink / raw)
  To: ptxdist

When upgrading from logrotate 3.8.7 to 3.9.1 a new patch
patches/logrotate-3.9.1/0001-deb-config-h.patch was introduced which
changed the paths to DEFAULT_MAIL_COMMAND and STATEFILE. The statefile
was created by logrotate in /var/lib before, now it expects
/var/lib/logrotate to be present. If the directory is missing, logrotate
fails with the following error:

    error: error creating state file /var/lib/logrotate/status: No such file or directory

So after upgrading to ptxdist 2015.07.0 (containing the above mentioned
upgrade) all calls to logrotate must have been failed. This can easily
be fixed by just creating the empty folder.

Note: users may have overridden the path to the state file by passing
another path together with the -s option of logrotate.

Fixes: 878707bd943a04fc8e3a55a151499359e81ce780
Signed-off-by: Alexander Dahl <ada@thorsis.com>
---
Meanwhile upstream moved to https://github.com/logrotate/logrotate and
published some new releases, maybe including changes to state file
handling. I'm afraid I have no time to investigate further, maybe
someone else wants to step in? O:-)

Greets
Alex
---
 rules/logrotate.make | 1 +
 1 file changed, 1 insertion(+)

diff --git a/rules/logrotate.make b/rules/logrotate.make
index e9dcaf9e5b..06f69d7206 100644
--- a/rules/logrotate.make
+++ b/rules/logrotate.make
@@ -52,6 +52,7 @@ $(STATEDIR)/logrotate.targetinstall:
 
 	@$(call install_copy, logrotate, 0, 0, 0755, -, /usr/sbin/logrotate)
 	@$(call install_alternative, logrotate, 0, 0, 0644, /etc/logrotate.conf)
+	@$(call install_copy, logrotate, 0, 0, 0755, /var/lib/logrotate)
 
 ifdef PTXCONF_LOGROTATE_SYSTEMD_UNIT
 	@$(call install_alternative, logrotate, 0, 0, 0644, \
-- 
2.11.0


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-02-06 13:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-06 13:29 [ptxdist] [PATCH] logrotate: Create directory for state file Alexander Dahl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox