From 03955eecea0ed58940d072654b9d1ac0ede074c6 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Pialasse Date: Tue, 30 Apr 2024 16:28:32 -0400 Subject: [PATCH] * Tue Apr 30 2024 Jean-Philippe Pialasse 11.0.0-8.sme - create dedicated log files and logrotate [SME: 12664] --- createlinks | 3 +++ root/etc/e-smith/templates/etc/rsyslog.conf/32smanager | 4 ++++ root/etc/logrotate.d/smanager | 4 +++- root/usr/lib/systemd/system/smanager.service | 2 +- root/var/log/smanager/.gitignore | 0 smeserver-manager.spec | 5 ++++- 6 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 root/etc/e-smith/templates/etc/rsyslog.conf/32smanager create mode 100644 root/var/log/smanager/.gitignore diff --git a/createlinks b/createlinks index 115c987..24d7747 100755 --- a/createlinks +++ b/createlinks @@ -47,6 +47,9 @@ for my $event ( qw( smeserver-manager-update smanager-refresh bootstrap-console- event_link('systemd-default', "smeserver-manager-update", '88'); event_link('systemd-reload', "smeserver-manager-update", '89'); +templates2events("/etc/rsyslog.conf", "smeserver-manager-update"); +safe_symlink("restart", + "root/etc/e-smith/events/smeserver-manager-update/services2adjust/rsyslog"); use esmith::Build::Backup qw(:all); backup_includes("smeserver-manager", qw( diff --git a/root/etc/e-smith/templates/etc/rsyslog.conf/32smanager b/root/etc/e-smith/templates/etc/rsyslog.conf/32smanager new file mode 100644 index 0000000..2f7d6e2 --- /dev/null +++ b/root/etc/e-smith/templates/etc/rsyslog.conf/32smanager @@ -0,0 +1,4 @@ +#smanager +:programname, isequal, "smanager" /var/log/smanager/smanager.log +& stop + diff --git a/root/etc/logrotate.d/smanager b/root/etc/logrotate.d/smanager index e119ab6..ad64e7b 100644 --- a/root/etc/logrotate.d/smanager +++ b/root/etc/logrotate.d/smanager @@ -1,4 +1,6 @@ -/usr/share/smanager/log/production.log { +/var/log/smanager/smanager.log { + su root root + create 600 root root weekly copytruncate rotate 12 diff --git a/root/usr/lib/systemd/system/smanager.service b/root/usr/lib/systemd/system/smanager.service index 9fe3edf..13beef0 100644 --- a/root/usr/lib/systemd/system/smanager.service +++ b/root/usr/lib/systemd/system/smanager.service @@ -7,7 +7,7 @@ After=network.target Type=simple SyslogIdentifier=smanager WorkingDirectory=/usr/share/smanager/script -PIDFile=/var/run/smanager.pid +PIDFile=/run/smanager.pid ExecStartPre=/sbin/e-smith/service-status smanager ExecStart=/usr/bin/hypnotoad srvmngr -f ExecStop=/usr/bin/hypnotoad -s srvmngr diff --git a/root/var/log/smanager/.gitignore b/root/var/log/smanager/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/smeserver-manager.spec b/smeserver-manager.spec index d7309c1..5db4ce2 100644 --- a/smeserver-manager.spec +++ b/smeserver-manager.spec @@ -2,7 +2,7 @@ Summary: Sme server navigation module : manager 2 %define name smeserver-manager Name: %{name} %define version 11.0.0 -%define release 7 +%define release 8 Version: %{version} Release: %{release}%{?dist} License: GPL @@ -108,6 +108,9 @@ true %defattr(-,root,root) %changelog +* Tue Apr 30 2024 Jean-Philippe Pialasse 11.0.0-8.sme +- create dedicated log files and logrotate [SME: 12664] + * Tue Apr 30 2024 Brian Read 11.0.0-7.sme - Remove use of hel command and replace by call to BlockDevices lib [SME: 12644]