MySQL logrotate script returns with error when server isn't running

Bug #513135 reported by reini on 2010-01-27
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MySQL Server
New
Unknown
mysql-dfsg-5.1 (Ubuntu)
Low
Unassigned
Nominated for Lucid by reini

Bug Description

Every day, I get a mail from the cron daemon that the logrotate script for mysql failed to run:

/etc/cron.daily/logrotate:
/usr/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'
Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!

I don't know what the little telephone is supposed to imply, but the mail is hugely annoying in the long run.
I only use mysql as a database for some projects I'm developing and therefore rarely need to run it. Since this is a laptop, I prefer to keep it inactive unless I need it. The logrotate script therefore usually can't connect to a running mysql daemon.

I would expect the script to silently do nothing, since this is not an error.

ProblemType: Bug
Architecture: i386
Date: Wed Jan 27 08:52:55 2010
DistroRelease: Ubuntu 9.10
MySQLConf.etc.mysql.conf.d.mysqld.safe.syslog.cnf:
 [mysqld_safe]
 syslog
MySQLVarLibDirListing: ['debian-5.1.flag', 'ibdata1', 'b98228_newsticker', 'debian-5.0.flag', 'growingdb', 'decidrdb', 'ib_logfile0', 'gb', 'mysql_upgrade_info', 'info', 'abihome', 'b98228_website', 'ib_logfile1', 'mysql_upgrade.info', 'mysql']
Package: mysql-server 5.1.37-1ubuntu5
PackageArchitecture: all
ProcEnviron:
 SHELL=/bin/bash
 PATH=(custom, user)
 LANG=de_DE.UTF-8
 LANGUAGE=
ProcVersionSignature: Ubuntu 2.6.31-18.55-generic
SourcePackage: mysql-dfsg-5.1
Uname: Linux 2.6.31-18-generic i686
XsessionErrors:
 (polkit-gnome-authentication-agent-1:2574): GLib-CRITICAL **: g_once_init_leave: assertion `initialization_value != 0' failed
 (firefox:2570): GLib-WARNING **: g_set_prgname() called multiple times
 (firefox:2570): GLib-WARNING **: g_set_prgname() called multiple times

reini (rrumberger) wrote :

On Wed, Jan 27, 2010 at 08:00:50AM -0000, reini wrote:
> Public bug reported:
>
> Every day, I get a mail from the cron daemon that the logrotate script
> for mysql failed to run:
>
> /etc/cron.daily/logrotate:
> /usr/bin/mysqladmin: connect to server at 'localhost' failed
> error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'
> Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!
>
>
> I don't know what the little telephone is supposed to imply, but the mail is hugely annoying in the long run.
> I only use mysql as a database for some projects I'm developing and therefore rarely need to run it. Since this is a laptop, I prefer to keep it inactive unless I need it. The logrotate script therefore usually can't connect to a running mysql daemon.
>
> I would expect the script to silently do nothing, since this is not an
> error.
>

Well - this is an edge use case. Most of the systems that have mysql-server
installed are running mysqld as a daemon and expect it to be running all the
time. If the daemon is not running, it may be a good thing that a notice is
sent. I don't know whether it should be a message from logrotate though.

  importance low
  status confirmed

--
Mathias Gug
Ubuntu Developer http://www.ubuntu.com

Changed in mysql-dfsg-5.1 (Ubuntu):
importance: Undecided → Low
status: New → Confirmed
reini (rrumberger) wrote :

Systems which actually need their mysqld will probably notice any failures long before the logrotate script does...

This behviour (i.e. assuming that a server is running, simply because it is installed) seems to be pretty common among Ubuntu scripts. Perhaps re-thinking that assuption in general may be useful. It has caused quite a few upgrade errors here.

Chuck Short (zulcss) on 2010-03-24
Changed in mysql-dfsg-5.1 (Ubuntu):
status: Confirmed → Fix Committed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package mysql-dfsg-5.1 - 5.1.41-3ubuntu8

---------------
mysql-dfsg-5.1 (5.1.41-3ubuntu8) lucid; urgency=low

  * debian/control: Add replaces mysql-server-5.0 for mysql-server-core-5.1 (LP: #537470)
  * debian/mysql-server-5.1.mysql-server.logrotate: Check to see if mysql is running before
    running logrotate. (LP: #513135)
  * Make the testsuite installable. (LP: #530752)
 -- Chuck Short <email address hidden> Wed, 24 Mar 2010 08:43:02 -0400

Changed in mysql-dfsg-5.1 (Ubuntu):
status: Fix Committed → Fix Released
Changed in mysql-server:
status: Unknown → New
Changed in mysql-server:
status: New → Fix Released
Changed in mysql-server:
status: Fix Released → New
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.