Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 414989 - mysql init script bad network handling
Summary: mysql init script bad network handling
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Linux MySQL bugs team
URL:
Whiteboard:
Keywords:
: 427012 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-05-07 09:18 UTC by Patrick Lauer
Modified: 2013-01-20 02:28 UTC (History)
3 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 Patrick Lauer gentoo-dev 2012-05-07 09:18:30 UTC
depend() {
        use net.lo
        # localmount needed for $basedir
        need localmount
}

So that's quite nice and all, but the mysql init script hangs indefinitely (>10min) at bootup and doesn't respond to ctrl-c, ctrl-s etc.

This effectively disables that machine as no local console is available and network + ssh hasn't been started yet. Need to reboot, remove mysql from runlevel and restart ... very very not nice.

120507 13:03:12  InnoDB: Initializing buffer pool, size = 20.0G
120507 13:03:14  InnoDB: Completed initialization of buffer pool
120507 13:03:15  InnoDB: Started; log sequence number 0 44233
120507 13:03:15 [ERROR] Can't start server: Bind on TCP/IP port: Cannot assign requested address
120507 13:03:15 [ERROR] Do you already have another mysqld server running on port: 3306 ?
120507 13:03:15 [ERROR] Aborting

This happens because net.eth0 is not started at that time as far as I can tell, so ... please make it behave sanely. 


Portage 2.1.10.49 (default/linux/amd64/10.0, gcc-4.5.3, glibc-2.14.1-r3, 3.2.12-gentoo x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-3.2.12-gentoo-x86_64-AMD_FX-tm-4100_Quad-Core_Processor-with-gentoo-2.0.3
Timestamp of tree: Mon, 07 May 2012 00:45:01 +0000
app-shells/bash:          4.2_p20
dev-lang/python:          2.7.2-r3, 3.2.2
dev-util/cmake:           2.8.6-r4
dev-util/pkgconfig:       0.26
sys-apps/baselayout:      2.0.3
sys-apps/openrc:          0.9.8.4
sys-apps/sandbox:         2.5
sys-devel/autoconf:       2.68
sys-devel/automake:       1.11.1
sys-devel/binutils:       2.21.1-r1
sys-devel/gcc:            4.5.3-r2
sys-devel/gcc-config:     1.5-r2
sys-devel/libtool:        2.4-r1
sys-devel/make:           3.82-r1
sys-kernel/linux-headers: 3.1 (virtual/os-headers)
sys-libs/glibc:           2.14.1-r3
Repositories: gentoo
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests binpkg-logs distlocks ebuild-locks fixlafiles news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS=""
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://192.168.0.8/gentoo-portage"
USE="acl amd64 berkdb bzip2 cli cracklib crypt cups cxx dri fortran gdbm gpm iconv ipv6 mmx modules mudflap multilib ncurses nls nptl openmp pam pcre pppd readline session sse sse2 ssl tcpd unicode xorg zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" 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 authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="fbdev glint intel mach64 mga neomagic nouveau nv r128 radeon savage sis tdfx trident vesa via vmware dummy v4l" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LINGUAS, MAKEOPTS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON

=================================================================
                        Package Settings
=================================================================

dev-db/mysql-5.1.62-r1 was built with the following:
USE="berkdb community (multilib) perl ssl -big-tables -cluster -debug -embedded -extraengine -latin1 -max-idx-128 -minimal -pbxt -profiling (-selinux) -static -test -xtradb"
CFLAGS="-O2 -pipe -DHAVE_ERRNO_AS_DEFINE=1 -fno-strict-aliasing"
CXXFLAGS="-O2 -pipe -DHAVE_ERRNO_AS_DEFINE=1 -fno-exceptions -fno-strict-aliasing -felide-constructors -fno-rtti -fno-implicit-templates -fno-strict-aliasing"
Comment 1 Patrick Lauer gentoo-dev 2012-05-07 09:21:21 UTC
Hackaround that works awesomely:

depend() {
        use net.lo net.eth0
        # localmount needed for $basedir
        need localmount
}

(Yes, I know that it is wrong in the general case, but at least that server cleanly boots now ...)
Comment 2 Brian Evans (RETIRED) gentoo-dev 2012-07-19 19:15:32 UTC
The answer appears to be in the conf.d file for mysql-init-scripts-2.0_pre1-r2.

# Does your MySQL bind to an IP on an interface other than net.lo?
# Alternatively you might wish to specify the exact interface here.
#rc_use="net"
#rc_after="net"

Did you remove the comment and modify the values to suit your needs?
Comment 3 Aidan Marks 2012-08-11 07:04:05 UTC
None of the suggestions work for me.  Tried adding use net.eth0 to /etc/init.d/mysql or setting rc_use or rc_after or both to net.eth0 and mysql still hangs on startup.

I use ifplugd.  I have to start mysql manually after booting.
Comment 4 Brian Evans (RETIRED) gentoo-dev 2012-08-29 20:58:24 UTC
(In reply to comment #3)
> None of the suggestions work for me.  Tried adding use net.eth0 to
> /etc/init.d/mysql or setting rc_use or rc_after or both to net.eth0 and
> mysql still hangs on startup.
> 
> I use ifplugd.  I have to start mysql manually after booting.

In your case, use rc_need="net.eth0" (or your specific interface)
You can also use rc_need="net" for all interfaces.

This will delay mysql from starting thanks to OpenRC.

Note that mysql will fail to start if the interface is never active.
IMPORTANT: This setting will gracefully stop mysql if the interface goes back to inactive.

If that last part is undesirable, then your only option looks to be the manual start/stop of mysql
Comment 5 Jorge Manuel B. S. Vicetto (RETIRED) gentoo-dev 2012-11-17 06:46:27 UTC
*** Bug 427012 has been marked as a duplicate of this bug. ***
Comment 6 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2013-01-20 02:28:48 UTC
No response from user since comment 4.