From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Tremer To: development@lists.ipfire.org Subject: Re: [PATCH] Restart logging after restoring backup Date: Mon, 14 Oct 2019 11:29:03 +0100 Message-ID: <85610A37-7A1F-40D4-911E-5A48827023C8@ipfire.org> In-Reply-To: <20191011184205.30715-1-ipfr@tfitzgeorge.me.uk> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5618481488484938014==" List-Id: --===============5618481488484938014== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Reviewed-by: Michael Tremer > On 11 Oct 2019, at 19:42, Tim FitzGeorge wrote: >=20 > Send SIGHUP to syslogd and suricata after restoring backup. This ensures t= hat > if the restored backup includes log files that any new log messages get > appended to the restored log files. Otherwise they will be written to the > old log files which are pending deletion. >=20 > httpd is told to restart using apachectl, which is the equivalent of sending > a signal. 'graceful' (USR1) is used rather than 'restart' (HUP) because the > latter immediately kills the process restoring the backup, preventing > converters from running. >=20 > Fixes: 12196 > Signed-off-by: Tim FitzGeorge > --- > config/backup/backup.pl | 5 +++++ > 1 file changed, 5 insertions(+) >=20 > diff --git a/config/backup/backup.pl b/config/backup/backup.pl > index 6ac4e4967..b1dd1d297 100644 > --- a/config/backup/backup.pl > +++ b/config/backup/backup.pl > @@ -71,6 +71,11 @@ restore_backup() { >=20 > tar xvzpf "${filename}" -C / >=20 > + # Restart syslogd, httpd and suricata in case we've just loaded old logs > + apachectl -k graceful > + /bin/kill -HUP `cat /var/run/suricata.pid 2> /dev/null` 2> /dev/null > + /bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null > + > # Run converters >=20 > # Outgoing Firewall > --=20 > 2.16.4 >=20 --===============5618481488484938014==--