Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 274145 - dev-db/mysql-init-scripts: mysqld fails to start with rc_parallel_startup=yes
Summary: dev-db/mysql-init-scripts: mysqld fails to start with rc_parallel_startup=yes
Status: RESOLVED TEST-REQUEST
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Gentoo Linux MySQL bugs team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-06-14 18:02 UTC by Stephen E. Baker
Modified: 2014-11-15 11:06 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stephen E. Baker 2009-06-14 18:02:25 UTC
Mysql does not start properly when RC_PARALLEL_STARTUP is set to "yes" in /etc/conf.d/rc

From /var/log/messages:
Jun  8 21:50:58 goodt60 rc-scripts: Strange, the socket file already exist in "/var/run/mysqld/mysqld.sock"
Jun  8 21:50:58 goodt60 rc-scripts: it will be removed now and re-created by the MySQL server
...
Jun  8 21:51:06 goodt60 rc-scripts: ERROR:  mysql failed to start

And then when trying to start it manually:
stephen@goodt60 ~ $ sudo /etc/init.d/mysql start
 * Service mysql starting                       
 "/var/run/mysqld/mysqld.pid" is still present and the process is running.
 Please stop it "kill 6876" maybe ?                                              [ !! ]
 * ERROR:  mysql failed to start                                                       
stephen@goodt60 ~ $ sudo /etc/init.d/mysql stop
 * WARNING:  mysql has not yet been started.   
stephen@goodt60 ~ $ sudo /etc/init.d/mysql start
 * Service mysql starting                       
 * Service mysql started


These messages go away and everything works as expected when I set
rc_parallel_startup="no".


Reproducible: Always

Steps to Reproduce:
1. Set RC_PARALLEL_STARTUP="yes" in /etc/conf.d/rc
2. rc-update add mysql
3. restart the computer

Actual Results:  
Mysql fails to start, .pid and .sock files are left in /var/run/mysqld despite no mysqld processes running.

Expected Results:  
mysqld would be running

This problem has existed for a very long time; I only recently discovered that it related to rc_parallel_startup but I've restarted several times.

My CPU is a Core 2 DUO

emerge --info:
Portage 2.1.6.13 (default/linux/x86/2008.0, gcc-4.3.2, glibc-2.8_p20080602-r1, 2.6.28-gentoo-r5 i686)                                                                         
=================================================================                      
System uname: Linux-2.6.28-gentoo-r5-i686-Intel-R-_Core-TM-2_CPU_T7400_@_2.16GHz-with-glibc2.0                                                                                
Timestamp of tree: Sun, 14 Jun 2009 04:30:01 +0000                                     
ccache version 2.4 [enabled]                                                           
app-shells/bash:     3.2_p39                                                           
dev-java/java-config: 2.1.7                                                            
dev-lang/python:     2.5.4-r2                                                          
dev-util/ccache:     2.4-r7                                                            
dev-util/cmake:      2.6.4                                                             
sys-apps/baselayout: 1.12.11.1                                                         
sys-apps/sandbox:    1.6-r2                                                            
sys-devel/autoconf:  2.13, 2.63                                                        
sys-devel/automake:  1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.2                         
sys-devel/binutils:  2.18-r3                                                           
sys-devel/gcc-config: 1.4.1                                                            
sys-devel/libtool:   1.5.26                                                            
virtual/os-headers:  2.6.27-r2                                                         
ACCEPT_KEYWORDS="x86"                                                                  
CBUILD="i686-pc-linux-gnu"                                                             
CFLAGS="-march=core2 -O2 -g"                                                           
CHOST="i686-pc-linux-gnu"                                                              
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/config"                                                                      
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c /etc/udev/rules.d"                                                                             
CXXFLAGS="-march=core2 -O2 -g"                                                         
DISTDIR="/usr/portage/distfiles"                                                       
FEATURES="ccache distlocks fixpackages parallel-fetch protect-owned sandbox sfperms strict unmerge-orphans userfetch"                                                         
GENTOO_MIRRORS="http://gentoo.mirrors.tera-byte.com/ ftp://mirror.csclub.uwaterloo.ca/gentoo-distfiles http://cdot.senecac.on.ca/software/gentoo/ http://distro.ibiblio.org/pub/linux/distributions/gentoo/"                                                         
LANG="en_CA.utf8"                                                                      
LDFLAGS="-Wl,-O1"                                                                      
LINGUAS="en"                                                                           
MAKEOPTS="-j3"                                                                         
PKGDIR="/usr/portage/packages"                                                         
PORTAGE_CONFIGROOT="/"                                                                 
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage/layman/interactive-fiction /usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X a52 aac acl acpi alsa amarok apache2 bash-completion berkdb bittorrent bzip2 cairo cdda cddb cdr cli cracklib crypt cscope cups curl dbus dio dri dvd dvdr dvdread encode fam ffmpeg firefox fortran gdbm gif gpm gtk hal htmlhandbook iconv icq imagemagick ipod ipv6 isdnlog java java5 javascript joystick jpeg jpeg2k kde kmid kpathsea libnotify libwww midi mikmod mmx mmxext mng mozdevelop mp3 mpeg mplayer msn mudflap mysql mysqli ncurses nls nptl nptlonly nsplugin ntfs offensive ogg opengl openmp oscar pam pcmcia pcre pdf perl plasma png posix postgres ppds pppd python qt3 qt4 quicktime readline reflection samda sdl session spell spl sse sse2 ssl subversion svg sysfs tcpd tetex threads truetype unicode usb videos vim-syntax vorbis wifi win32codecs wma wxwindows x86 xine xml xorg xosd xulrunner xv xvid zlib" ALSA_CARDS="hda-intel" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic auth_digest authn_anon authn_dbd authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif so speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="evdev synaptics keyboard mouse joystick" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en" USERLAND="GNU" VIDEO_CARDS="vesa radeon"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2010-03-24 19:50:32 UTC
I can't reproduce this on current openrc/baselayout2, please retest.
Comment 2 Stephen E. Baker 2010-03-25 12:30:40 UTC
I've switched to another distribution and won't be able to retest, sorry.
Comment 3 sphakka 2011-01-06 21:08:41 UTC
Hi there,
The problem persists with:

  mysql               5.1.53
  mysql-init-scripts  1.2
  baselayout          1.12.14-r1

After boot, calling twice '/etc/init.d/mysql start' cleans up the pid/socket remnants and succeeds to start teh server.

Any chance to have it solved on baselayout-1? I didn't venture on baselayout-2, as it is still in testing...

Cheers,

  ^s
Comment 4 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2011-01-06 21:42:13 UTC
sphakka: please try the new init scripts from the mysql overlay.
Comment 5 sphakka 2011-01-19 18:29:24 UTC
(In reply to comment #4)
> sphakka: please try the new init scripts from the mysql overlay.
> 

OK, confirmed. 
It works for me (both sequential and parallel init) with:

  mysql-init-scripts 2.0_pre1-r2
  baselayout         2.0.1-r1

Cheers,

  ^s

Comment 6 vince 2014-11-15 11:06:34 UTC
FYI for anyone who has this problem

if your MySQL is listening on an external interface make sure that the init script depends on net rather than net.lo.

Cheers,