Patrick Shanahan wrote:
* Per Jessen <per@opensuse.org> [04-23-23 10:54]:
I don't rememeber the last time I did a TW installation from scratch.
yeah, once you get it installed the first time, "It Just Works" :)
Still, occasionally some minor surprises - network config now is networkmanager only, at least by default. It was easy to install wicked though. Next I had to add 'net.ifnames=0' to the boot config. Good stuff.
Another small surprise - unable to restart syslog. "Unit var-run.mount not found". It does in fact not exist. On a 2nd TW system, that unit seems to have been provided by systemd-sysvcompat.
nscd complains about not finding /etc/services and /etc/nsswitch.conf - (the symlinks to /usr/etc are missing). question - do files in /etc/ override same-named files in /usr/etc ? For instance, I want to change the logrotate config for /var/log/messages. Do I create /etc/logrotate.d/syslog with the new definition or should I give that config file a different name? syslog-ng doesn't seem to use /usr/etc, the default config went into /etc. -- Per Jessen, Zürich (14.1°C) Member, openSUSE Heroes (2016 - present) We're hiring - https://en.opensuse.org/openSUSE:Heroes
On 23.04.2023 19:06, Per Jessen wrote:
nscd complains about not finding /etc/services and /etc/nsswitch.conf - (the symlinks to /usr/etc are missing).
question - do files in /etc/ override same-named files in /usr/etc ?
They should as long as it is supported by application/library accessing these files.
For instance, I want to change the logrotate config for /var/log/messages. Do I create /etc/logrotate.d/syslog with the new definition or should I give that config file a different name?
IIRC logrotate configuration files do not really support overriding individual entries (at least, there was some rather weird bug resulting from it), so you better replace the whole file.
Andrei Borzenkov wrote:
On 23.04.2023 19:06, Per Jessen wrote:
nscd complains about not finding /etc/services and /etc/nsswitch.conf - (the symlinks to /usr/etc are missing).
question - do files in /etc/ override same-named files in /usr/etc ?
They should as long as it is supported by application/library accessing these files.
For instance, I want to change the logrotate config for /var/log/messages. Do I create /etc/logrotate.d/syslog with the new definition or should I give that config file a different name?
IIRC logrotate configuration files do not really support overriding individual entries (at least, there was some rather weird bug resulting from it), so you better replace the whole file.
Thanks, done. -- Per Jessen, Zürich (15.0°C) Member, openSUSE Heroes (2016 - present) We're hiring - https://en.opensuse.org/openSUSE:Heroes
Per Jessen wrote:
nscd complains about not finding /etc/services and /etc/nsswitch.conf - (the symlinks to /usr/etc are missing).
It looks like nscd complains everytime someone does a lookup :-( I guess nscd does not understand about /usr/etc. Here is what I don't understand - /etc/nsswitch.conf and /etc/gai.conf are listed as being provided by package "glibc", which obviously _is_ installed, 2.37-3.1. Do "rpm -ql glibc" to see it. How does this work? The package is installed, but the files (nor any symlinks) do not exist? office24:/var/log/YaST2 # rpm -qf /usr/etc/nsswitch.conf /etc/nsswitch.conf glibc-2.37-3.1.x86_64 glibc-2.37-3.1.x86_64 office24:/var/log/YaST2 # ls -la /usr/etc/nsswitch.conf /etc/nsswitch.conf ls: cannot access '/etc/nsswitch.conf': No such file or directory -rw-r--r-- 1 root root 2190 Apr 18 09:37 /usr/etc/nsswitch.conf -- Per Jessen, Zürich (16.1°C) Member, openSUSE Heroes (2016 - present) We're hiring - https://en.opensuse.org/openSUSE:Heroes
On 23.04.2023 19:57, Per Jessen wrote:
Per Jessen wrote:
nscd complains about not finding /etc/services and /etc/nsswitch.conf - (the symlinks to /usr/etc are missing).
It looks like nscd complains everytime someone does a lookup :-( I guess nscd does not understand about /usr/etc.
Here is what I don't understand -
/etc/nsswitch.conf and /etc/gai.conf are listed as being provided by package "glibc", which obviously _is_ installed, 2.37-3.1. Do "rpm -ql glibc" to see it.
How does this work? The package is installed, but the files (nor any symlinks) do not exist?
These are ghost files. Their content is not present in RPM package, but they get deleted when package is removed.
office24:/var/log/YaST2 # rpm -qf /usr/etc/nsswitch.conf /etc/nsswitch.conf glibc-2.37-3.1.x86_64 glibc-2.37-3.1.x86_64 office24:/var/log/YaST2 # ls -la /usr/etc/nsswitch.conf /etc/nsswitch.conf ls: cannot access '/etc/nsswitch.conf': No such file or directory -rw-r--r-- 1 root root 2190 Apr 18 09:37 /usr/etc/nsswitch.conf
Andrei Borzenkov wrote:
On 23.04.2023 19:57, Per Jessen wrote:
How does this work? The package is installed, but the files (nor any symlinks) do not exist?
These are ghost files. Their content is not present in RPM package, but they get deleted when package is removed.
I guess in this case that isn't too important, glibc is never removed - but what about an update? Looking at my 2nd TW system, they are still there, files about three years old, although it has a few updates pending. What/where is the issue with nscd - should it be updated to deal with /usr/etc or should someone/something create the symlink ? -- Per Jessen, Zürich (16.4°C) Member, openSUSE Heroes (2016 - present) We're hiring - https://en.opensuse.org/openSUSE:Heroes
On 23.04.2023 20:48, Per Jessen wrote:
Andrei Borzenkov wrote:
On 23.04.2023 19:57, Per Jessen wrote:
How does this work? The package is installed, but the files (nor any symlinks) do not exist?
These are ghost files. Their content is not present in RPM package, but they get deleted when package is removed.
I guess in this case that isn't too important, glibc is never removed - but what about an update? Looking at my 2nd TW system, they are still there, files about three years old, although it has a few updates pending.
Files are still marked as config and no-replace, so if they are present they remain present.
What/where is the issue with nscd - should it be updated to deal with /usr/etc
bor@tw:~> ll /etc/services ls: cannot access '/etc/services': No such file or directory bor@tw:~> getent services ssh ssh 22/tcp bor@tw:~> What exactly does not work?
or should someone/something create the symlink ?
Andrei Borzenkov wrote:
On 23.04.2023 20:48, Per Jessen wrote:
What/where is the issue with nscd - should it be updated to deal with /usr/etc
bor@tw:~> ll /etc/services ls: cannot access '/etc/services': No such file or directory bor@tw:~> getent services ssh ssh 22/tcp bor@tw:~>
What exactly does not work?
/etc/services is fine, and I presume nscd is fine about /etc/nsswitch.ch, but it still keeps complaining about /etc/nsswitch.ch. -- Per Jessen, Zürich (14.2°C) Member, openSUSE Heroes (2016 - present) We're hiring - https://en.opensuse.org/openSUSE:Heroes
On Sun, Apr 23, 2023 at 9:42 PM Per Jessen <per@opensuse.org> wrote:
/etc/services is fine, and I presume nscd is fine about /etc/nsswitch.ch, but it still keeps complaining about /etc/nsswitch.ch.
Well, support for /usr/etc/nsswitch.conf is really minimal - it simply tries to open it if /etc/nsswitch.conf does not exist. You certainly can open a bug report.
On 2023-04-24 09:05, Andrei Borzenkov wrote:
On Sun, Apr 23, 2023 at 9:42 PM Per Jessen <per@opensuse.org> wrote:
/etc/services is fine, and I presume nscd is fine about /etc/nsswitch.ch, but it still keeps complaining about /etc/nsswitch.ch.
Well, support for /usr/etc/nsswitch.conf is really minimal - it simply tries to open it if /etc/nsswitch.conf does not exist. You certainly can open a bug report.
I have a freshly installed TW since about a week ago. How come these two differ? And when they do, who to trust and use? # ls -la /usr/etc/nsswitch.conf* /etc/nsswitch.conf* -rw-r--r-- 1 root root 2221 Apr 13 09:54 /etc/nsswitch.conf -rw-r--r-- 1 root root 2190 Apr 18 09:37 /usr/etc/nsswitch.conf # diff /usr/etc/nsswitch.conf /etc/nsswitch.conf 61c61 < hosts: files dns ---
hosts: files mdns_minimal [NOTFOUND=return] dns
-- /bengan
On Mon, Apr 24, 2023 at 10:29 AM Bengt Gördén <bengan@bag.org> wrote:
On 2023-04-24 09:05, Andrei Borzenkov wrote:
On Sun, Apr 23, 2023 at 9:42 PM Per Jessen <per@opensuse.org> wrote:
/etc/services is fine, and I presume nscd is fine about /etc/nsswitch.ch, but it still keeps complaining about /etc/nsswitch.ch.
Well, support for /usr/etc/nsswitch.conf is really minimal - it simply tries to open it if /etc/nsswitch.conf does not exist. You certainly can open a bug report.
I have a freshly installed TW since about a week ago. How come these two differ? And when they do, who to trust and use?
# ls -la /usr/etc/nsswitch.conf* /etc/nsswitch.conf* -rw-r--r-- 1 root root 2221 Apr 13 09:54 /etc/nsswitch.conf -rw-r--r-- 1 root root 2190 Apr 18 09:37 /usr/etc/nsswitch.conf
# diff /usr/etc/nsswitch.conf /etc/nsswitch.conf 61c61 < hosts: files dns ---
hosts: files mdns_minimal [NOTFOUND=return] dns
Some packages modify nsswitch.conf. Check where mdns_minimal comes from, look at package scripts.
Op maandag 24 april 2023 09:48:08 CEST schreef Andrei Borzenkov:
On Mon, Apr 24, 2023 at 10:29 AM Bengt Gördén <bengan@bag.org> wrote:
On 2023-04-24 09:05, Andrei Borzenkov wrote:
On Sun, Apr 23, 2023 at 9:42 PM Per Jessen <per@opensuse.org> wrote:
/etc/services is fine, and I presume nscd is fine about /etc/nsswitch.ch, but it still keeps complaining about /etc/nsswitch.ch.
Well, support for /usr/etc/nsswitch.conf is really minimal - it simply tries to open it if /etc/nsswitch.conf does not exist. You certainly can open a bug report.
I have a freshly installed TW since about a week ago. How come these two differ? And when they do, who to trust and use?
# ls -la /usr/etc/nsswitch.conf* /etc/nsswitch.conf* -rw-r--r-- 1 root root 2221 Apr 13 09:54 /etc/nsswitch.conf -rw-r--r-- 1 root root 2190 Apr 18 09:37 /usr/etc/nsswitch.conf
# diff /usr/etc/nsswitch.conf /etc/nsswitch.conf 61c61 < hosts: files dns ---
hosts: files mdns_minimal [NOTFOUND=return] dns
Some packages modify nsswitch.conf. Check where mdns_minimal comes from, look at package scripts.
An openSUSE specific policy is available in: https://en.opensuse.org/openSUSE:Packaging_UsrEtc which offers 3 variants, which make things quite unclear what has been implemented in a specific package. It should be documented in the man page, or something such, which variant has been chosen in that specific package. -- fr.gr. member openSUSE Freek de Kruijf
Bengt Gördén wrote:
On 2023-04-24 09:05, Andrei Borzenkov wrote:
On Sun, Apr 23, 2023 at 9:42 PM Per Jessen <per@opensuse.org> wrote:
/etc/services is fine, and I presume nscd is fine about /etc/nsswitch.ch, but it still keeps complaining about /etc/nsswitch.ch.
Well, support for /usr/etc/nsswitch.conf is really minimal - it simply tries to open it if /etc/nsswitch.conf does not exist. You certainly can open a bug report.
I have a freshly installed TW since about a week ago. How come these two differ? And when they do, who to trust and use?
# ls -la /usr/etc/nsswitch.conf* /etc/nsswitch.conf* -rw-r--r-- 1 root root 2221 Apr 13 09:54 /etc/nsswitch.conf -rw-r--r-- 1 root root 2190 Apr 18 09:37 /usr/etc/nsswitch.conf
# diff /usr/etc/nsswitch.conf /etc/nsswitch.conf 61c61 < hosts: files dns ---
hosts: files mdns_minimal [NOTFOUND=return] dns
I see the same - albeit on an older TW system, office25, with desktop. I think it is nss-mdns - check out the config script /usr/sbin/nss-mdns-config. When the two files differ, I would certainly expect /etc/nsswitch.ch to take precedence. -- Per Jessen, Zürich (12.2°C) Member, openSUSE Heroes (2016 - present) We're hiring - https://en.opensuse.org/openSUSE:Heroes
Andrei Borzenkov wrote:
On Sun, Apr 23, 2023 at 9:42 PM Per Jessen <per@opensuse.org> wrote:
/etc/services is fine, and I presume nscd is fine about /etc/nsswitch.ch, but it still keeps complaining about /etc/nsswitch.ch.
Well, support for /usr/etc/nsswitch.conf is really minimal - it simply tries to open it if /etc/nsswitch.conf does not exist. You certainly can open a bug report.
Yeah, I know :-) I have created a symlink instead. Wrt $SUBJ - my logrotate changes didn't work. I created a /etc/logrotate.d/syslog with new definitions for /var/log/messages and /var/log/mail, but it seems it was ignored. Not in any way critical of course. Just little TW nuisances. -- Per Jessen, Zürich (12.4°C) Member, openSUSE Heroes (2016 - present) We're hiring - https://en.opensuse.org/openSUSE:Heroes
On Mon, Apr 24, 2023 at 11:04 AM Per Jessen <per@opensuse.org> wrote:
Wrt $SUBJ - my logrotate changes didn't work. I created a /etc/logrotate.d/syslog with new definitions for /var/log/messages and /var/log/mail, but it seems it was ignored.
Were those definitions in /usr/etc/logrotate.d/syslog?
Andrei Borzenkov wrote:
On Mon, Apr 24, 2023 at 11:04 AM Per Jessen <per@opensuse.org> wrote:
Wrt $SUBJ - my logrotate changes didn't work. I created a /etc/logrotate.d/syslog with new definitions for /var/log/messages and /var/log/mail, but it seems it was ignored.
Were those definitions in /usr/etc/logrotate.d/syslog?
Yes, /usr/etc/logrotate.d/syslog has definitions for a lot of log files [1], including those two. I thought I would be able to override with office24:/etc/logrotate.d # cat syslog /var/log/messages /var/log/mail { compress dateext maxage 365 rotate 30 missingok notifempty daily sharedscripts postrotate /usr/bin/systemctl reload syslog.service > /dev/null endscript } [1] from /usr/etc/logrotate.d/syslog : /var/log/warn /var/log/messages /var/log/allmessages /var/log/localmessages /var/log/firewall /var/log/acpid /var/log/NetworkManager /var/log/mail /var/log/mail.info /var/log/mail.warn /var/log/mail.err /var/log/news/news.crit /var/log/news/news.err /var/log/news/news.notice { compress dateext maxage 365 rotate 99 missingok notifempty size +4096k sharedscripts postrotate /usr/bin/systemctl reload syslog.service > /dev/null endscript } -- Per Jessen, Zürich (8.3°C) Member, openSUSE Heroes (2016 - present) We're hiring - https://en.opensuse.org/openSUSE:Heroes
On Mon, Apr 24, 2023 at 11:48 AM Per Jessen <per@opensuse.org> wrote:
Andrei Borzenkov wrote:
On Mon, Apr 24, 2023 at 11:04 AM Per Jessen <per@opensuse.org> wrote:
Wrt $SUBJ - my logrotate changes didn't work. I created a /etc/logrotate.d/syslog with new definitions for /var/log/messages and /var/log/mail, but it seems it was ignored.
Were those definitions in /usr/etc/logrotate.d/syslog?
Yes, /usr/etc/logrotate.d/syslog has definitions for a lot of log files [1], including those two. I thought I would be able to override with
Let's start from the beginning. How are you running logrotate? Is it the default logrotate.timer which calls logrotate.service? Do you have your own cron job or something else? Do you have /etc/logrotate.conf? Does it explicitly include any files? How do you test your modifications? Are you calling logrotate manually? If yes, how exactly?
office24:/etc/logrotate.d # cat syslog /var/log/messages /var/log/mail { compress dateext maxage 365 rotate 30 missingok notifempty daily sharedscripts postrotate /usr/bin/systemctl reload syslog.service > /dev/null endscript }
[1] from /usr/etc/logrotate.d/syslog :
/var/log/warn /var/log/messages /var/log/allmessages /var/log/localmessages /var/log/firewall /var/log/acpid /var/log/NetworkManager /var/log/mail /var/log/mail.info /var/log/mail.warn /var/log/mail.err /var/log/news/news.crit /var/log/news/news.err /var/log/news/news.notice { compress dateext maxage 365 rotate 99 missingok notifempty size +4096k sharedscripts postrotate /usr/bin/systemctl reload syslog.service > /dev/null endscript }
-- Per Jessen, Zürich (8.3°C) Member, openSUSE Heroes (2016 - present) We're hiring - https://en.opensuse.org/openSUSE:Heroes
Andrei Borzenkov wrote:
On Mon, Apr 24, 2023 at 11:48 AM Per Jessen <per@opensuse.org> wrote:
Andrei Borzenkov wrote:
On Mon, Apr 24, 2023 at 11:04 AM Per Jessen <per@opensuse.org> wrote:
Wrt $SUBJ - my logrotate changes didn't work. I created a /etc/logrotate.d/syslog with new definitions for /var/log/messages and /var/log/mail, but it seems it was ignored.
Were those definitions in /usr/etc/logrotate.d/syslog?
Yes, /usr/etc/logrotate.d/syslog has definitions for a lot of log files [1], including those two. I thought I would be able to override with
Let's start from the beginning.
How are you running logrotate? Is it the default logrotate.timer which calls logrotate.service? Do you have your own cron job or something else?
Excluding my attempted change for /var/log/message and /var/log/mail, everything is installation default. On a systemd timer and it works. (I mean, it was triggered). office24:/etc # systemctl status logrotate.timer ● logrotate.timer - Daily rotation of log files Loaded: loaded (/usr/lib/systemd/system/logrotate.timer; enabled; preset: enabled) Active: active (waiting) since Sun 2023-04-23 17:52:48 CEST; 17h ago Trigger: Tue 2023-04-25 00:00:00 CEST; 12h left Triggers: ● logrotate.service Docs: man:logrotate(8) man:logrotate.conf(5) Apr 23 17:52:48 office24 systemd[1]: Started Daily rotation of log files. office24:/etc # systemctl status logrotate.service ○ logrotate.service - Rotate log files Loaded: loaded (/usr/lib/systemd/system/logrotate.service; static) Active: inactive (dead) since Mon 2023-04-24 00:00:45 CEST; 11h ago TriggeredBy: ● logrotate.timer Docs: man:logrotate(8) man:logrotate.conf(5) Process: 2161 ExecStart=/usr/sbin/logrotate-all (code=exited, status=0/SUCCESS) Main PID: 2161 (code=exited, status=0/SUCCESS) CPU: 145ms Apr 24 00:00:45 office24 systemd[1]: Starting Rotate log files... Apr 24 00:00:45 office24 systemd[1]: logrotate.service: Deactivated successfully. Apr 24 00:00:45 office24 systemd[1]: Finished Rotate log files. I'm a little bit surprised about the 45second delay, but for this it doesn't matter.
Do you have /etc/logrotate.conf? Does it explicitly include any files?
No, there is only /etc/logrotate.d with two files, mcelog and my new syslog. office24:/etc # l logrotate.d/ total 32 drwxr-xr-x 2 root root 4096 Apr 24 09:51 ./ drwxr-xr-x 98 root root 8192 Apr 24 10:08 ../ -rw-r--r-- 1 root root 267 Mar 20 06:02 mcelog -rw-r--r-- 1 root root 238 Apr 23 18:00 syslog
How do you test your modifications? Are you calling logrotate manually? If yes, how exactly?
To be honest, I didn't test them :-) I do this modification on every new install, hopefully I know it by now. I'll look up how to to run a test run. -- Per Jessen, Zürich (9.4°C) Member, openSUSE Heroes (2016 - present) We're hiring - https://en.opensuse.org/openSUSE:Heroes
Per Jessen wrote:
Andrei Borzenkov wrote:
How do you test your modifications? Are you calling logrotate manually? If yes, how exactly?
To be honest, I didn't test them :-) I do this modification on every new install, hopefully I know it by now.
I'll look up how to to run a test run.
logrotate -d -v /usr/etc/logrotate.conf /etc/logrotate.d/syslog (a dry run). [snip some] rotating pattern: /var/log/messages /var/log/mail after 1 days (30 rotations) empty log files are not rotated, old logs are removed considering log /var/log/messages Now: 2023-04-24 11:29 Last rotated at 2023-04-24 00:00 log does not need rotating (log has been rotated at 2023-04-24 00:00, which is less than a day ago) considering log /var/log/mail Now: 2023-04-24 11:29 Last rotated at 2023-04-24 00:00 log does not need rotating (log has been rotated at 2023-04-24 00:00, which is less than a day ago) not running postrotate script, since no logs were rotated ------------------------------ Running a rotate with 'force' works: rotating pattern: /var/log/messages /var/log/mail forced from command line (30 rotations) empty log files are not rotated, old logs are removed considering log /var/log/messages Now: 2023-04-24 11:32 Last rotated at 2023-04-24 00:00 log needs rotating considering log /var/log/mail Now: 2023-04-24 11:32 Last rotated at 2023-04-24 00:00 log needs rotating rotating log /var/log/messages, log->rotateCount is 30 dateext suffix '-20230424' glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]' glob finding old rotated logs failed rotating log /var/log/mail, log->rotateCount is 30 dateext suffix '-20230424' glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]' glob finding old rotated logs failed renaming /var/log/messages to /var/log/messages-20230424 creating new /var/log/messages mode = 0640 uid = 0 gid = 0 renaming /var/log/mail to /var/log/mail-20230424 creating new /var/log/mail mode = 0640 uid = 0 gid = 0 running postrotate script compressing log with: /usr/bin/xz compressing log with: /usr/bin/xz --------------------------------------- Okay, I guess the next one has to be with the full config. -- Per Jessen, Zürich (9.9°C) Member, openSUSE Heroes (2016 - present) We're hiring - https://en.opensuse.org/openSUSE:Heroes
Per Jessen wrote:
Per Jessen wrote:
Running a rotate with 'force' works:
[snip]
Okay, I guess the next one has to be with the full config.
Run manually with force, that worked too. systemd hardening? -- Per Jessen, Zürich (10.7°C) Member, openSUSE Heroes (2016 - present) We're hiring - https://en.opensuse.org/openSUSE:Heroes
On Mon, Apr 24, 2023 at 12:45 PM Per Jessen <per@opensuse.org> wrote:
Per Jessen wrote:
Per Jessen wrote:
Running a rotate with 'force' works:
[snip]
Okay, I guess the next one has to be with the full config.
Run manually with force, that worked too. systemd hardening?
of course systemd is always to blame, but this is standard logrotate behavior
considering log /var/log/messages Now: 2023-04-24 11:29 Last rotated at 2023-04-24 00:00 log does not need rotating (log has been rotated at 2023-04-24 00:00, which is less than a day ago)
Andrei Borzenkov wrote:
On Mon, Apr 24, 2023 at 12:45 PM Per Jessen <per@opensuse.org> wrote:
Per Jessen wrote:
Per Jessen wrote:
Running a rotate with 'force' works:
[snip]
Okay, I guess the next one has to be with the full config.
Run manually with force, that worked too. systemd hardening?
of course systemd is always to blame, but this is standard logrotate behavior
Now it is, yes, but at midnight it did not do what it was supposed to do.
considering log /var/log/messages Now: 2023-04-24 11:29 Last rotated at 2023-04-24 00:00 log does not need rotating (log has been rotated at 2023-04-24 00:00, which is less than a day ago)
Yes, the status file confirms that, yet the logfiles were _not_ rotated at midnight. I'm beginning to expect a Heisenbug - it'll probably work just fine tonight. -- Per Jessen, Zürich (13.4°C) Member, openSUSE Heroes (2016 - present) We're hiring - https://en.opensuse.org/openSUSE:Heroes
On Mon, Apr 24, 2023 at 12:21 PM Per Jessen <per@opensuse.org> wrote:
Andrei Borzenkov wrote:
On Mon, Apr 24, 2023 at 11:48 AM Per Jessen <per@opensuse.org> wrote:
Andrei Borzenkov wrote:
On Mon, Apr 24, 2023 at 11:04 AM Per Jessen <per@opensuse.org> wrote:
Wrt $SUBJ - my logrotate changes didn't work. I created a /etc/logrotate.d/syslog with new definitions for /var/log/messages and /var/log/mail, but it seems it was ignored.
Were those definitions in /usr/etc/logrotate.d/syslog?
Yes, /usr/etc/logrotate.d/syslog has definitions for a lot of log files [1], including those two. I thought I would be able to override with
Let's start from the beginning.
How are you running logrotate? Is it the default logrotate.timer which calls logrotate.service? Do you have your own cron job or something else?
Excluding my attempted change for /var/log/message and /var/log/mail, everything is installation default. On a systemd timer and it works. (I mean, it was triggered).
office24:/etc # systemctl status logrotate.timer ● logrotate.timer - Daily rotation of log files Loaded: loaded (/usr/lib/systemd/system/logrotate.timer; enabled; preset: enabled) Active: active (waiting) since Sun 2023-04-23 17:52:48 CEST; 17h ago Trigger: Tue 2023-04-25 00:00:00 CEST; 12h left Triggers: ● logrotate.service Docs: man:logrotate(8) man:logrotate.conf(5)
Apr 23 17:52:48 office24 systemd[1]: Started Daily rotation of log files. office24:/etc # systemctl status logrotate.service ○ logrotate.service - Rotate log files Loaded: loaded (/usr/lib/systemd/system/logrotate.service; static) Active: inactive (dead) since Mon 2023-04-24 00:00:45 CEST; 11h ago TriggeredBy: ● logrotate.timer Docs: man:logrotate(8) man:logrotate.conf(5) Process: 2161 ExecStart=/usr/sbin/logrotate-all (code=exited, status=0/SUCCESS) Main PID: 2161 (code=exited, status=0/SUCCESS) CPU: 145ms
Apr 24 00:00:45 office24 systemd[1]: Starting Rotate log files... Apr 24 00:00:45 office24 systemd[1]: logrotate.service: Deactivated successfully. Apr 24 00:00:45 office24 systemd[1]: Finished Rotate log files.
I'm a little bit surprised about the 45second delay, but for this it doesn't matter.
Do you have /etc/logrotate.conf? Does it explicitly include any files?
No, there is only /etc/logrotate.d with two files, mcelog and my new syslog.
office24:/etc # l logrotate.d/ total 32 drwxr-xr-x 2 root root 4096 Apr 24 09:51 ./ drwxr-xr-x 98 root root 8192 Apr 24 10:08 ../ -rw-r--r-- 1 root root 267 Mar 20 06:02 mcelog -rw-r--r-- 1 root root 238 Apr 23 18:00 syslog
How do you test your modifications? Are you calling logrotate manually? If yes, how exactly?
To be honest, I didn't test them :-) I do this modification on every new install, hopefully I know it by now.
Then how do you know that your changes did not work? And do not forget that /etc/logrotate.d/syslog will completely replace /usr/etc/logrotate.d/syslog with all that is defined there.
Andrei Borzenkov wrote:
On Mon, Apr 24, 2023 at 12:21 PM Per Jessen <per@opensuse.org> wrote:
To be honest, I didn't test them :-) I do this modification on every new install, hopefully I know it by now.
Then how do you know that your changes did not work?
I specify a daily rotation, and there wasn't one :-)
And do not forget that /etc/logrotate.d/syslog will completely replace /usr/etc/logrotate.d/syslog with all that is defined there.
Yes, that surprised me. I'll have to do some more testing. -- Per Jessen, Zürich (10.6°C) Member, openSUSE Heroes (2016 - present) We're hiring - https://en.opensuse.org/openSUSE:Heroes
Per Jessen wrote:
Andrei Borzenkov wrote:
On Mon, Apr 24, 2023 at 12:21 PM Per Jessen <per@opensuse.org> wrote:
To be honest, I didn't test them :-) I do this modification on every new install, hopefully I know it by now.
Then how do you know that your changes did not work?
I specify a daily rotation, and there wasn't one :-)
And do not forget that /etc/logrotate.d/syslog will completely replace /usr/etc/logrotate.d/syslog with all that is defined there.
Yes, that surprised me. I'll have to do some more testing.
FWIW, it isn't possible to override individual rotations - logrotate complains about duplicate definitions. So it means copy original to /etc/logrotate.d and then modify. Fair enough. -- Per Jessen, Zürich (13.4°C) Member, openSUSE Heroes (2016 - present) We're hiring - https://en.opensuse.org/openSUSE:Heroes
Per Jessen wrote:
Yes, /usr/etc/logrotate.d/syslog has definitions for a lot of log files [1], including those two. I thought I would be able to override with
Okay, the support for /usr/etc is a little bit simplistic - there is a script /usr/sbin/logrotate-all - if /etc/logrotate.d/config exists it completely overrides /usr/etc/logrotate.d/config. In my case, that is fine, even if a bit surprising. -- Per Jessen, Zürich (9.5°C) Member, openSUSE Heroes (2016 - present) We're hiring - https://en.opensuse.org/openSUSE:Heroes
participants (4)
-
Andrei Borzenkov
-
Bengt Gördén
-
Freek de Kruijf
-
Per Jessen