Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 133940 - mysqld fails to start if /var/run/mysqld does not exist
Summary: mysqld fails to start if /var/run/mysqld does not exist
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: x86 Linux
: High major (vote)
Assignee: Gentoo Linux MySQL bugs team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-05-21 04:46 UTC by Igor Vinokurov
Modified: 2006-05-21 06:43 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 Igor Vinokurov 2006-05-21 04:46:04 UTC
Portage 2.0.54-r2 (default-linux/x86/2006.0, gcc-3.4.4, glibc-2.3.5-r2, 2.6.16-g                                                                                                      entoo-r6 i686)
=================================================================
System uname: 2.6.16-gentoo-r6 i686 Intel(R) Pentium(R) 4 CPU 1.80GHz
Gentoo Base System version 1.6.14
dev-lang/python:     2.4.2
dev-python/pycrypto: [Not Present]
dev-util/ccache:     [Not Present]
dev-util/confcache:  [Not Present]
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.59-r6
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1
sys-devel/binutils:  2.16.1
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=i686 -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/share/                                                                                                      config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/eselect/compiler /etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O2 -march=i686 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks sandbox sfperms strict"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/                                                                                                      distributions/gentoo"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 bzip2 minimal nls pam pcre perl python ssl zlib userland_GNU kernel_lin                                                                                                      ux elibc_glibc"
Unset:  ASFLAGS, CTARGET, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, LINGUAS, MAKEOPTS                                                                                                      , PORTAGE_RSYNC_EXTRA_OPTS, PORTAGE_RSYNC_OPTS, PORTDIR_OVERLAY
Comment 1 Luca Longinotti (RETIRED) gentoo-dev 2006-05-21 05:13:40 UTC
This is expected, if the DATADIR is not there, it will not start...
I just checked the ebuilds, and it's all correct, if the "minimal" USE is not set (as minimal MySQL builds don't have the mysqld), then /var/run/mysqld is created correctly. Same goes for /var/lib/mysql and all the other needed directories, so I can't understand the problem... The ebuild will create it, if it didn't, then it may be a Portage bug, some other error (permissions?) or whatever...
Best regards, CHTEKK.
Comment 2 Jakub Moc (RETIRED) gentoo-dev 2006-05-21 05:30:54 UTC
So remove USE="minimal" from your flags... Besides, there's nothing to start, no daemon compiled with this flag.
Comment 3 Igor Vinokurov 2006-05-21 06:10:31 UTC
/var/run may be mounted via tmpfs, and /var/run/mysqld (created at emerge stage), not created again after reboot.

"minimal" USE is not set, of course.

(In reply to comment #1)
> This is expected, if the DATADIR is not there, it will not start...
> I just checked the ebuilds, and it's all correct, if the "minimal" USE is not
> set (as minimal MySQL builds don't have the mysqld), then /var/run/mysqld is
> created correctly. Same goes for /var/lib/mysql and all the other needed
> directories, so I can't understand the problem... The ebuild will create it, if
> it didn't, then it may be a Portage bug, some other error (permissions?) or
> whatever...
> Best regards, CHTEKK.
> 
Comment 4 Igor Vinokurov 2006-05-21 06:18:29 UTC
As you know files in /var/run usually cleared when the system boots. For example, /var/run may be mounted via tmpfs, and /var/run/mysqld (created at emerge stage), not created again after reboot.

"minimal" USE is not set, of course.

(In reply to comment #1)
> This is expected, if the DATADIR is not there, it will not start...
> I just checked the ebuilds, and it's all correct, if the "minimal" USE is not
> set (as minimal MySQL builds don't have the mysqld), then /var/run/mysqld is
> created correctly. Same goes for /var/lib/mysql and all the other needed
> directories, so I can't understand the problem... The ebuild will create it, if
> it didn't, then it may be a Portage bug, some other error (permissions?) or
> whatever...
> Best regards, CHTEKK.
> 
Comment 5 Jakub Moc (RETIRED) gentoo-dev 2006-05-21 06:20:40 UTC
(In reply to comment #3)
> /var/run may be mounted via tmpfs, and /var/run/mysqld (created at emerge
> stage), not created again after reboot.

Sigh... How is this mysql or portage problem? So don't do such stuff like putting /var/run on mounts that go away on reboot... If you do, then feel free to fix such self-inflicted problems yourself.
Comment 6 Jakub Moc (RETIRED) gentoo-dev 2006-05-21 06:21:56 UTC
(In reply to comment #4)
> As you know files in /var/run usually cleared when the system boots. 

No, it isn't. mysql specifically does keepdir for this not to happen.
Comment 7 Igor Vinokurov 2006-05-21 06:28:34 UTC
"self-inflicted"?

escape ~ # uname -a
Linux escape 2.6.16-gentoo-r6 #1 SMP PREEMPT Tue May 9 16:30:32 MSD 2006 i686 Intel(R) Pentium(R) 4 CPU 1.80GHz GenuineIntel GNU/Linux
escape ~ # zcat /usr/share/man/man7/hier.7.gz | nroff -man | grep -A 3 /var/run
       /var/run
              Run-time  variable files, like files holding process identifiers
              (PIDs) and logged user information (utmp).  Files in this direc-
              tory are usually cleared when the system boots.
escape ~ #

(In reply to comment #5)
> (In reply to comment #3)
> > /var/run may be mounted via tmpfs, and /var/run/mysqld (created at emerge
> > stage), not created again after reboot.
> 
> Sigh... How is this mysql or portage problem? So don't do such stuff like
> putting /var/run on mounts that go away on reboot... If you do, then feel free
> to fix such self-inflicted problems yourself.
> 
Comment 8 Francesco R. (RETIRED) gentoo-dev 2006-05-21 06:29:45 UTC
I agree with jakub,
Sorry, then you need to recreate the needed dirs, in /var/run, to check and create it is _not_ a work for the init.d scripts.

The reason for this is that push a check more for thousand of users, for a configuration that only few computers have is not optimal.


A suggestion, create a script /etc/init.d/beforemysql with these two functions

depend() {
        before mysql
}

start {
        create_all_needed()
}

and then add it to startup with rc-update.
Regards
Comment 9 Igor Vinokurov 2006-05-21 06:43:32 UTC
As `grep mkdir /etc/init.d/*` shows that it is common practice to check necessary dirs at startup and IMO first of all solution must work "correctly" first and only afterwards "optimal", but its IMO only.

Especially, if this check run once at [rare] startup.

(In reply to comment #8)
> I agree with jakub,
> Sorry, then you need to recreate the needed dirs, in /var/run, to check and
> create it is _not_ a work for the init.d scripts.
> 
> The reason for this is that push a check more for thousand of users, for a
> configuration that only few computers have is not optimal.
> 
> 
> A suggestion, create a script /etc/init.d/beforemysql with these two functions
> 
> depend() {
>         before mysql
> }
> 
> start {
>         create_all_needed()
> }
> 
> and then add it to startup with rc-update.
> Regards
>