LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 01-15-2024, 01:05 AM   #1
teoberi
Member
 
Registered: Jan 2018
Location: Romania
Distribution: Slackware64-current (servers)/Windows 11/Ubuntu (workstations)
Posts: 615

Rep: Reputation: 359Reputation: 359Reputation: 359Reputation: 359
Duplicate log entry for /var/lib/mysql/mysqld.log


Quote:
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
In /etc/logrotate.d/ I have:
mariadb
mysql
A simple Google search:
https://www.ucartz.com/clients/knowl...ysqld.log.html
https://www.suse.com/support/kb/doc/?id=000016984
We proceed in the same way, what can we delete?
 
Old 01-15-2024, 01:18 AM   #2
Thom1b
Member
 
Registered: Mar 2010
Location: France
Distribution: Slackware
Posts: 486

Rep: Reputation: 339Reputation: 339Reputation: 339Reputation: 339
Hi,
I guess /etc/logrotate.d/mysql was in mariadb and had been replaced by /etc/logrotate.d/mariadb. You can simply delete /etc/logrotate.d/mysql.

Same issue here since dcron sends error mail
 
1 members found this post helpful.
Old 01-15-2024, 01:28 AM   #3
teoberi
Member
 
Registered: Jan 2018
Location: Romania
Distribution: Slackware64-current (servers)/Windows 11/Ubuntu (workstations)
Posts: 615

Original Poster
Rep: Reputation: 359Reputation: 359Reputation: 359Reputation: 359
Quote:
Originally Posted by Thom1b View Post
Hi,
I guess /etc/logrotate.d/mysql was in mariadb and had been replaced by /etc/logrotate.d/mariadb. You can simply delete /etc/logrotate.d/mysql.

Same issue here since dcron sends error mail
I suspected this, but it would be good if it was officially resolved.
 
Old 01-17-2024, 01:50 AM   #4
teoberi
Member
 
Registered: Jan 2018
Location: Romania
Distribution: Slackware64-current (servers)/Windows 11/Ubuntu (workstations)
Posts: 615

Original Poster
Rep: Reputation: 359Reputation: 359Reputation: 359Reputation: 359
Final solution!
When starting MariaDB we get:
Quote:
mysqld_safe Logging to '/var/lib/mysql/xxx.err'.
In /etc/logrotate.d in the mysql file it appears:
Quote:
/var/lib/mysql/mysqld.log
In /etc/logrotate.d/ in the mariadb file it appears:
Quote:
/var/lib/mysql/mysqld.log /var/lib/mysql/mariadb.log /var/log/mysql/*.log
In mariadb.SlackBuild appears:
Quote:
mv $PKG/etc/logrotate.d/mariadb $PKG/etc/logrotate.d/mariadb.new
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)

Last edited by teoberi; 01-17-2024 at 04:19 AM.
 
Old 01-17-2024, 03:59 AM   #5
Petri Kaukasoina
Senior Member
 
Registered: Mar 2007
Posts: 1,865

Rep: Reputation: 1527Reputation: 1527Reputation: 1527Reputation: 1527Reputation: 1527Reputation: 1527Reputation: 1527Reputation: 1527Reputation: 1527Reputation: 1527Reputation: 1527
Quote:
Originally Posted by teoberi View Post
the /etc/logrotate.d/mysql file can be deleted.
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.
 
1 members found this post helpful.
Old 01-17-2024, 05:20 AM   #6
Petri Kaukasoina
Senior Member
 
Registered: Mar 2007
Posts: 1,865

Rep: Reputation: 1527Reputation: 1527Reputation: 1527Reputation: 1527Reputation: 1527Reputation: 1527Reputation: 1527Reputation: 1527Reputation: 1527Reputation: 1527Reputation: 1527
Quote:
Originally Posted by Petri Kaukasoina View Post
obsolete config files are always left behind when either the package is removed or upgraded to a new version without that file.
What are these obsolete config files:
Code:
#!/bin/sh
# obsolete_new: find obsolete .new files
# pk 2024-01-17
cd /var/log/removed_packages
grep -h '\.new$' *|sort -u|\
while read fnew; do
  cd /var/log/packages
  f=${fnew%.new}
  if ! grep -qE "^$fnew$|^$f$" *; then    
    [ -f "/$f" -a ! -L "/$f" ] && echo "/$f"
  fi
done

Last edited by Petri Kaukasoina; 01-18-2024 at 05:31 AM. Reason: Changed package directory names to make it work also on 14.2
 
2 members found this post helpful.
Old 01-17-2024, 07:45 AM   #7
teoberi
Member
 
Registered: Jan 2018
Location: Romania
Distribution: Slackware64-current (servers)/Windows 11/Ubuntu (workstations)
Posts: 615

Original Poster
Rep: Reputation: 359Reputation: 359Reputation: 359Reputation: 359
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.
https://stackify.com/linux-logs/
/var/log/spooler
Rarely used and often empty. When used, it contains messages from USENET

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
 
Old 01-17-2024, 08:05 AM   #8
Petri Kaukasoina
Senior Member
 
Registered: Mar 2007
Posts: 1,865

Rep: Reputation: 1527Reputation: 1527Reputation: 1527Reputation: 1527Reputation: 1527Reputation: 1527Reputation: 1527Reputation: 1527Reputation: 1527Reputation: 1527Reputation: 1527
Quote:
Originally Posted by teoberi View Post
/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 View Post
/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.
 
1 members found this post helpful.
Old 01-20-2024, 07:51 AM   #9
BroX
Member
 
Registered: Oct 2003
Location: Sweden
Distribution: Slackware64-current, SlackwareARM-15.0
Posts: 833

Rep: Reputation: 90
Quote:
Originally Posted by Petri Kaukasoina View Post
What are these obsolete config files:
Code:
#!/bin/sh
# obsolete_new: find obsolete .new files
# pk 2024-01-17
cd /var/log/removed_packages
grep -h '\.new$' *|sort -u|\
while read fnew; do
  cd /var/log/packages
  f=${fnew%.new}
  if ! grep -qE "^$fnew$|^$f$" *; then    
    [ -f "/$f" -a ! -L "/$f" ] && echo "/$f"
  fi
done
Code:
line 5: /usr/bin/grep: Argument list too long
What could be wrong with my grep?
 
1 members found this post helpful.
Old 01-20-2024, 08:24 AM   #10
Petri Kaukasoina
Senior Member
 
Registered: Mar 2007
Posts: 1,865

Rep: Reputation: 1527Reputation: 1527Reputation: 1527Reputation: 1527Reputation: 1527Reputation: 1527Reputation: 1527Reputation: 1527Reputation: 1527Reputation: 1527Reputation: 1527
Quote:
Originally Posted by BroX View Post
Code:
line 5: /usr/bin/grep: Argument list too long
What could be wrong with my grep?
Nothing wrong in it. You have so many files in /var/log/removed_packages that '*' expands to too long a command line.

Last edited by Petri Kaukasoina; 01-20-2024 at 08:52 AM.
 
Old 01-20-2024, 08:43 AM   #11
Petri Kaukasoina
Senior Member
 
Registered: Mar 2007
Posts: 1,865

Rep: Reputation: 1527Reputation: 1527Reputation: 1527Reputation: 1527Reputation: 1527Reputation: 1527Reputation: 1527Reputation: 1527Reputation: 1527Reputation: 1527Reputation: 1527
Try this instead:
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 ! grep -qE "^$fnew$|^$f$" *; then    
    [ -f "/$f" -a ! -L "/$f" ] && echo "/$f"
  fi
done

Last edited by Petri Kaukasoina; 01-20-2024 at 09:04 AM.
 
1 members found this post helpful.
Old 01-20-2024, 09:42 AM   #12
BroX
Member
 
Registered: Oct 2003
Location: Sweden
Distribution: Slackware64-current, SlackwareARM-15.0
Posts: 833

Rep: Reputation: 90
Quote:
Originally Posted by Petri Kaukasoina View Post
Try this instead:
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 ! grep -qE "^$fnew$|^$f$" *; then    
    [ -f "/$f" -a ! -L "/$f" ] && echo "/$f"
  fi
done
 
Old 01-20-2024, 09:50 AM   #13
Petri Kaukasoina
Senior Member
 
Registered: Mar 2007
Posts: 1,865

Rep: Reputation: 1527Reputation: 1527Reputation: 1527Reputation: 1527Reputation: 1527Reputation: 1527Reputation: 1527Reputation: 1527Reputation: 1527Reputation: 1527Reputation: 1527
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
 
Old 01-22-2024, 07:49 AM   #14
drumz
Member
 
Registered: Apr 2005
Location: Oklahoma, USA
Distribution: Slackware
Posts: 907

Rep: Reputation: 697Reputation: 697Reputation: 697Reputation: 697Reputation: 697Reputation: 697
Quote:
Originally Posted by Petri Kaukasoina View Post
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?):

Code:
# obsolete_new 
/etc/grub.d/20_memtest86+
# grep 20_memtest86 /var/lib/pkgtools/packages/*
/var/lib/pkgtools/packages/memtest86+-6.20-x86_64-1_SBo:etc/grub.d/20_memtest86+.new
 
1 members found this post helpful.
Old 01-22-2024, 09:24 AM   #15
Petri Kaukasoina
Senior Member
 
Registered: Mar 2007
Posts: 1,865

Rep: Reputation: 1527Reputation: 1527Reputation: 1527Reputation: 1527Reputation: 1527Reputation: 1527Reputation: 1527Reputation: 1527Reputation: 1527Reputation: 1527Reputation: 1527
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.
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
sudo cp -rp ./mysqld ./mysqld.bak cp: cannot stat './mysqld': No such file or directory 5huvoo Linux - Server 5 03-06-2018 02:10 PM
[SOLVED] after installation of MySQL could not log into mysql using temporary password in /var/log/mysqld.log User247 Linux - Server 2 12-25-2017 09:31 AM
mysqld from pid file /var/run/mysqld/mysqld.pid ended gabsik Linux - Server 3 12-11-2016 10:15 AM
Problem with MySQL install on virt CentOS,no /var/lib/mysql/mysql.sock , systemctl start mysqld.service dont run the service Positive1 CentOS 1 08-13-2016 03:33 AM
[SOLVED] Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' Burningmace Linux - Server 5 09-06-2012 01:29 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 04:56 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration