[MDEV-10646] System Unit File After network-online Created: 2016-08-22  Updated: 2017-03-08  Due: 2017-03-10  Resolved: 2017-03-08

Status: Closed
Project: MariaDB Server
Component/s: Packaging
Affects Version/s: 10.1
Fix Version/s: 10.1.22

Type: Bug Priority: Major
Reporter: Jason Ross Assignee: Sergey Vojtovich
Resolution: Fixed Votes: 0
Labels: contribution, foundation, patch

Sprint: 10.1.22

 Description   

Currently, the unit file specifies "After=network.target" which only guarantees that the network service has started. It should also specify "After=network-online.target" which will order startup after the network service has completed startup and is configured

Without this, slow to configure networks may not be up before we start, and if the IP that we bind to hasn't been configured by the network service yet, we fail to start



 Comments   
Comment by Sergey Vojtovich [ 2016-08-24 ]

According to https://www.freedesktop.org/wiki/Software/systemd/NetworkTarget/

It is strongly recommended not to pull in this target too liberally: for example network server software should generally not pull this in (since server software generally is happy to accept local connections even before any routable network interface is up), it's primary purpose is network client software that cannot operate without network.

Comment by Jason Ross [ 2016-08-24 ]

"since server software generally is happy to accept local connections even before any routable network interface is up"

This statement if fundamentally flawed for any server that attempts to bind only to a specific interface rather than 0.0.0.0

If we set a bind interface, the service fails to start because it attempts to start before the ip is assigned.

Comment by scottmcg [ 2017-01-09 ]

I have this same issue. I have many servers with two interfaces, i choose to specify the backend/private interfaces address in my.cnf bind config. But systemd tries to start mariadb before the interface is ready and fails with aforementioned error.

Comment by Sergey Vojtovich [ 2017-03-07 ]

I agree it is very valid problem. What I disagree with is suggested fix, that is I don't think MariaDB should wait for network-online.target by default.

E.g. default debian installation binds to 127.0.0.1, which is available after network.target. Default RPM installation doesn't have bind either.

I believe IP_FREEBIND (suggested by the link above) is more appropriate fix for this issue.

Comment by Sergey Vojtovich [ 2017-03-07 ]

serg, please review fix for this bug.

Comment by Jason Ross [ 2017-03-07 ]

Reviewing the above link again, I agree that IP_FREEBIND is the correct solution.

Generated at Thu Feb 08 07:43:50 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.