[SOLVED] Duplicate log entry for /var/lib/mysql/mysqld.log
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
cron for user root /usr/bin/run-parts /etc/cron.daily 1> /dev/null
Contact photo
From root@xxx.ro on 2024-01-15 04:40
Details Headers
error: mysql:21 duplicate log entry for /var/lib/mysql/mysqld.log
error: found error in file mysql, skipping
Files /usr/share/mysql/mariadb.logrotate is identical to /etc/logrotate.d/mariadb
In conclusion, I think that the /etc/logrotate.d/mysql file can be deleted.
An even better solution is to uninstall MariaDB and replace it with PostgreSQL. (proceed carefully because now Apache depends on MariaDB)
An older mariadb package contains file '/etc/logrotate.d/mysql.new'. Files with suffix .new are moved to place without .new. upgradepkg uses removepkg to remove the old package, but removepkg can't remove /etc/logrotate.d/mysql because it tries to remove the original /etc/logrotate.d/mysql.new and it does not exist. That's why obsolete config files are always left behind when either the package is removed or upgraded to a new version without that file.
Examples found:
/etc/gamin/gaminrc -> package removed form Slackware on Sun Nov 20 00:54:24 UTC 2022 (l/gamin-0.1.10-x86_64-9.txz: Removed.)
/etc/login.access replaced with /etc/security/access.conf
/etc/rc.d/rc.openvpn -> package removed (by me)
/var/log/spooler -> I still don't know what's with him https://support.hpe.com/hpesc/public...ocLocale=en_US
Quote:
/var/log/cups /var/log/spooler - All printer and printing related log messages.
Something I still don't understand:
/etc/iproute2/bpf_pinning
/etc/iproute2/ematch_map
/etc/iproute2/group
/etc/iproute2/nl_protos
/etc/iproute2/rt_dsfield
/etc/iproute2/rt_protos
/etc/iproute2/rt_realms
/etc/iproute2/rt_scopes
/etc/iproute2/rt_tables
files with the extension .new exist in the package iproute2-6.7.0-x86_64-1.txz https://packages.slackware.com/?r=sl...x86_64-1.txz&f
/var/log/spooler -> I still don't know what's with him
sysklogd-1.5.1-x86_64-3-upgraded-2020-06-26,23:12:41:var/log/spooler.new
But it's not in the latest sysklogd package.
Quote:
Originally Posted by teoberi
/etc/iproute2/bpf_pinning
/etc/iproute2/ematch_map
/etc/iproute2/group
/etc/iproute2/nl_protos
/etc/iproute2/rt_dsfield
/etc/iproute2/rt_protos
/etc/iproute2/rt_realms
/etc/iproute2/rt_scopes
/etc/iproute2/rt_tables
files with the extension .new exist in the package iproute2-6.7.0-x86_64-1.txz
The files with same names are in /usr/lib/iproute2 now. The directory /etc/iproute2 should be empty.
I don't know if it's possible to install so many packages that even /var/log/packages would have too many file names for the second grep in the script. This version changes also that one to use find:
Code:
#!/bin/sh
# obsolete_new: find obsolete .new files
# pk 2024-01-17 2024-01-20
cd /var/log/removed_packages
find . -type f -exec grep -h '\.new$' '{}' +|sort -u|\
while read fnew; do
cd /var/log/packages
f=${fnew%.new}
if ! find . -type f -exec grep -qE "^$fnew$|^$f$" '{}' +; then
[ -f "/$f" -a ! -L "/$f" ] && echo "/$f"
fi
done
I don't know if it's possible to install so many packages that even /var/log/packages would have too many file names for the second grep in the script. This version changes also that one to use find:
Code:
#!/bin/sh
# obsolete_new: find obsolete .new files
# pk 2024-01-17 2024-01-20
cd /var/log/removed_packages
find . -type f -exec grep -h '\.new$' '{}' +|sort -u|\
while read fnew; do
cd /var/log/packages
f=${fnew%.new}
if ! find . -type f -exec grep -qE "^$fnew$|^$f$" '{}' +; then
[ -f "/$f" -a ! -L "/$f" ] && echo "/$f"
fi
done
I get one false positive (guessing due to the plus sign in the file name?):
Yes, it seems to be due to the '-E' option of the second grep. I used extended regular expressions to be able to match either 'file.new' or 'file' lines in the packages directory. But '+' has a special meaning in regexps. (So do '*' and '?' but fortunately they are seldom used in file names.)
I think it should work if we change
Code:
grep -qE "^$fnew$|^$f$"
to
Code:
grep -q -e "^$fnew$" -e "^$f$"
Would you try this below?
Code:
#!/bin/sh
# obsolete_new: find obsolete .new files
# pk 2024-01-17 2024-01-20 2024-01-22
cd /var/log/removed_packages
find . -type f -exec grep -h '\.new$' '{}' +|sort -u|\
while read fnew; do
cd /var/log/packages
f=${fnew%.new}
if ! find . -type f -exec grep -q -e "^$fnew$" -e "^$f$" '{}' +; then
[ -f "/$f" -a ! -L "/$f" ] && echo "/$f"
fi
done
Last edited by Petri Kaukasoina; 01-22-2024 at 09:27 AM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.