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

SystemD "Alias=mysql" considered harmful

    XMLWordPrintable

Details

    Description

      Our SystemD service file contains an "Alias=mysql.service" entry, so that things like

      systemctl stop mysql
      

      still work when using "mysql" instead of "mariadb".

      We also still install a "mysql" SysV/LSB init script in /etc/init.d.

      Now the problem is: the "mysql.service" alias only exists when the "mariadb" service is enabled, when it is disabled the mysql.service symlinks are removed.

      So when the "mariadb" service is enabled systemctl start mysql is an alias for systemctl start mariadb, when the "mariadb" service is disabled it will fall back to the old SysV script in /etc/init.d/mysql, which still gets installed, but behaves differently than the SystemD service (eg. still uses mysqld_safe).

      In my opinion the symlink from mariadb.service to mysql.service should be created permanently by the RPM install scriptlet, instead of relying on an Alias= entry in the service file.

      The alias only being available at some times is already confusing, and in combination with the still distributed SysV init script by the same base name it really becomes harmful.

      Attachments

        Issue Links

          Activity

            People

              serg Sergei Golubchik
              hholzgra Hartmut Holzgraefe
              Votes:
              1 Vote for this issue
              Watchers:
              6 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.