Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 811255 - dev-db/mysql-init-scripts-2.3-r3: mysqld can not start if "bind-address" is set without localhost at boot time
Summary: dev-db/mysql-init-scripts-2.3-r3: mysqld can not start if "bind-address" is s...
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal minor (vote)
Assignee: Gentoo Linux MySQL bugs team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-08-31 13:30 UTC by ujtwr
Modified: 2021-09-03 13:07 UTC (History)
1 user (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 ujtwr 2021-08-31 13:30:22 UTC
mysqld can not start if bind-address is set without localhost at boot time.

mysqld init script (/etc/init.d/mysql) set dependency as bellow:

depend() {
        use net.lo
        ...skip....
}

If "bind-address" is set in mysqld config file like "bind-address=192.168.0.2", mysqld can not bind the ip address because network interface is not up before mysqld.

So, I modify the init script as bellow:

depend() {
-        use net.lo
+        use net
        ...skip....
}






Reproducible: Always

Steps to Reproduce:
1. Set an ip address with out localhost to "bind-address" in mysqld config file 
2. reboot
3. init process stop on mysqld start until timeout
Comment 1 Thomas Deutschmann (RETIRED) gentoo-dev 2021-09-03 10:38:50 UTC
No, this is not a bug in mysql-init-scripts. Please read more about bug 439092. If you change service to depend on specific interface, you are supposed to tell that your service manager, too.

tl;dr
If your mysql instance (/etc/init.d/mysql) depends on net.yourInterface42 because you altered default MySQL config and added bind-address below /etc/mysql, you have to add

> rc_use="net.yourInterface42"

(or rc_need instead of rc_use depending on your requirements)

to /etc/conf.d/mysql to make your instance depend on that specific interface.
Comment 2 ujtwr 2021-09-03 13:07:53 UTC
Thanx, Thomas Deutschmann, 

This was my lack of understanding. I will try to read the documents you pointed.