Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-10646

System Unit File After network-online

Details

    • 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

      Attachments

        Activity

          svoj Sergey Vojtovich added a comment - - edited

          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.

          svoj Sergey Vojtovich added a comment - - edited 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.
          csfreak Jason Ross added a comment -

          "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.

          csfreak Jason Ross added a comment - "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.
          ninjascroll scottmcg added a comment -

          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.

          ninjascroll scottmcg added a comment - 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.

          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.

          svoj Sergey Vojtovich added a comment - 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.

          serg, please review fix for this bug.

          svoj Sergey Vojtovich added a comment - serg , please review fix for this bug.
          csfreak Jason Ross added a comment -

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

          csfreak Jason Ross added a comment - Reviewing the above link again, I agree that IP_FREEBIND is the correct solution.

          People

            svoj Sergey Vojtovich
            csfreak Jason Ross
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.