Summary: | mysqld fails to start if /var/run/mysqld does not exist | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Igor Vinokurov <a-12345> |
Component: | Eclasses | Assignee: | Gentoo Linux MySQL bugs team <mysql-bugs> |
Status: | RESOLVED WORKSFORME | ||
Severity: | major | CC: | a-12345, chtekk, jakub |
Priority: | High | ||
Version: | 2006.0 | ||
Hardware: | x86 | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- |
Description
Igor Vinokurov
2006-05-21 04:46:04 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. So remove USE="minimal" from your flags... Besides, there's nothing to start, no daemon compiled with this flag. /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. > 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. > (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. (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. "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. > 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 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 > |