Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 173057 - mysql does not start up properly
Summary: mysql does not start up properly
Status: RESOLVED DUPLICATE of bug 175783
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Linux MySQL bugs team
URL:
Whiteboard:
Keywords:
Depends on: 175783
Blocks:
  Show dependency tree
 
Reported: 2007-04-01 22:37 UTC by Daniel
Modified: 2008-11-14 21:51 UTC (History)
0 users

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


Attachments
SysV Init output (init-out.txt,4.64 KB, text/plain)
2007-04-02 18:36 UTC, Daniel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel 2007-04-01 22:37:46 UTC
Gentoo's apache2 init script seems to have a "funny" problem at my site:

Imagine a paranoid Apache-Setup:
Here Apache2 is started manually (not listed in rc-update show, below) because Apache's TLS-KeyFile is encrypted by a passphrase, that has to be entered manually.

During boot-up: mysql get's startet automatically (rc-update show reports: mysql default) so far so good. Apache is skipped (see above, because of an encrypted TLS-Key), also ok.

Starting Apache manually after boot-up and a login into shell as root: "/etc/init.d/apache2 start") the following error is reported:

systemX # /etc/init.d/apache2 start
 * Starting mysql ...
 * "/var/run/mysqld/mysqld.pid" is still present and the process is running.
 * Please stop it "kill 14820" maybe ?

Of course, mysql is already running, but that shouldn't be a problem. (?!) ;-)

Because of this error Apache2 can not be started directly. First mysql has to be stopped "/etc/init.d/mysql stop" successfully and after that "/etc/init.d/apache2 start" will also start it's previously stopped dependency "mysql". (and /etc/init.d/mysql start && /etc/init.d/apache2 works also fine!)

Once this manual procedure has been successfully (apache2 can be started without any error). It is not reproduceable until  next reboot. So you probably can not reproduce it by simply log into your system stop mysql and/or apache and start them independently (in any order!). This little "magic" occurs only once - right after bootup.

It is reproduceable only by:
"shutdown -r now, login, manually execute /etc/init.d/apache2 start" ;-)

Just a guess, I haven't investigated in deep: Could it be that, the dependency-resolution-mechanism (a kind of return-codes of init-scripts or so?!) is confused/lost between init-process and the following login shell because these are two independent processes?

Never the less, Gentoo rocks! ;-)


Reproducible: Always

Steps to Reproduce:
1. please
2. see
3. above description

Actual Results:  
right after boot-up on first system login (as root) Apache2 init script can not be started manually if mysql has been started by init before.


Portage 2.1.2.2 (default-linux/x86/2006.1, gcc-4.1.1, glibc-2.5-r0, 2.6.18-gentoo-r6 i686)
=================================================================
System uname: 2.6.18-gentoo-r6 i686 Intel(R) Pentium(R) M processor 1.80GHz
Gentoo Base System release 1.12.9
Timestamp of tree: Sun, 01 Apr 2007 01:20:01 +0000
ccache version 2.4 [enabled]
dev-java/java-config: 1.3.7, 2.0.31
dev-lang/python:     2.3.5-r3, 2.4.3-r4
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache:     2.4-r6
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.61
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils:  2.16.1-r3
sys-devel/gcc-config: 1.3.14
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.17-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=pentium4 -fomit-frame-pointer -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/lib/fax /usr/share/X11/xkb /usr/share/config /var/bind /var/spool/fax/etc"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/java-config/vms/ /etc/php/apache1-php4/ext-active/ /etc/php/apache1-php5/ext-active/ /etc/php/apache2-php4/ext-active/ /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php4/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php4/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/splash /etc/terminfo"
CXXFLAGS="-O2 -march=pentium4 -fomit-frame-pointer -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="ccache distlocks metadata-transfer sandbox sfperms strict"
GENTOO_MIRRORS="ftp://sunsite.informatik.rwth-aachen.de/pub/Linux/gentoo http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror/ ftp://linux.rz.ruhr-uni-bochum.de/gentoo-mirror/ http://ftp.uni-erlangen.de/pub/mirrors/gentoo ftp://ftp.uni-erlangen.de/pub/mirrors/gentoo ftp://ftp.join.uni-muenster.de/pub/linux/distributions/gentoo ftp://ftp.wh2.tu-dresden.de/pub/mirrors/gentoo ftp://ftp.join.uni-muenster.de/pub/linux/distributions/gentoo ftp://ftp6.uni-muenster.de/pub/linux/distributions/gentoo http://mirrors.sec.informatik.tu-darmstadt.de/gentoo/ http://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/ ftp://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/overlays/gentoo-de"
SYNC="rsync://rsync.de.gentoo.org/gentoo-portage"
USE="a52 aac aalib acpi alsa apache2 audiofile bash-completion bcmath berkdb bitmap-fonts bzlib caps cdb cdparanoia cdr cli cracklib crypt ctype cups curl curlwrappers dedicated directfb dri dvd dvdr ethereal exif fam fbcon flash fortran freetype ftp gd gif gpm gps iconv icq ieee1394 imagemagick imlib ipv6 isdnlog jabber java javascript jpeg kde kerberos ldap libg++ libwww lm_sensors logrotate mhash midi milter mime mmx mng mysql ncurses nls nptl nptlonly offensive opengl pam pcntl pcre pdf perl php png posix ppds pppd python qt readline reflection rrdtool ruby sasl session sharedext slp snmp sockets socks5 spell spl sse sse2 ssl svg svgalib symlink tcltk tcpd threads tidy tiff truetype truetype-fonts type1-fonts unicode usb vhosts wmf x86 xml xml2 xmlrpc xorg xpm xsl xv zlib" ALSA_CARDS="intel8x0" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" DVB_CARDS="ttpci nxt200x sp8870 tda1004x or51132 or51211" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIRC_DEVICES="serial" USERLAND="GNU" VIDEO_CARDS="i810 vesa fbdev"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 SpanKY gentoo-dev 2007-04-01 23:06:31 UTC
i doubt apache has anything to do with it ...

once you boot up, if you run `/etc/init.d/mysql status`, does it show a similar error ?
Comment 2 Daniel 2007-04-02 18:33:41 UTC
You are so right:

during boot-up init.d reports:
* Starting mysql (/etc/mysql/my.cnf)
 * MySQL NOT started (0)                                         [ !! ]

Although mysqld is running, "/etc/init.d/mysql status" reports the above error, too.

I think the previously described problem (apache/mysql) is is a kind of side-effect regarding my very complex service-setup:
- local slapd, local nsswitch.conf configured to use pam_ldap and nss_ldap
- local named chrooted

The following services do not start up properly:
named (chroot)
mysql (don't know exactyl why, I think it has to do with not running named)
asterisk (depend use mysql)
apache2 (depend use mysql)

mit-krb5kdc (because default realm is configured in DNS-Zone, and named is not started)
mit-krb5kadmin (because kdc has not been started)

Any other services startup quite fine.

Just one more question: What is the reason named is started first (before any other service?). I thought slapd is more "important", because it resolves the chroot-lookup via nsswitch.conf, to allow named to be started chrooted?
slapd is configured using IP addresses only so it does not depend on a working DNS.

Just for your information I attach the init.d-output during boot-up (from serial console) into an attachment, so you can see the order the services will be started.
Comment 3 Daniel 2007-04-02 18:36:00 UTC
Created attachment 115312 [details]
SysV Init output
Comment 4 Roy Marples (RETIRED) gentoo-dev 2007-07-11 13:20:16 UTC
The issue is with the mysql init script - the one on bug #175783 should fix this.
Comment 5 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2008-11-14 21:51:36 UTC

*** This bug has been marked as a duplicate of bug 175783 ***