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

systemd: change Restart=on-failure to on-abort?

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Duplicate
    • 10.1(EOL)
    • N/A
    • Packaging
    • None

    Description

      While implementing systemd packaging part for MariaDB 10.1 in Debian and while comparing to MySQL 5.7 in Debian/Ubuntu, I noticed that the mysql.service file recommends against using `Restart=on-failure` and instead suggests `on-abort`:

      mysql-server-5.7.mysql.service
      # MySQL systemd service file
       
      [Unit]
      Description=MySQL Community Server
      After=network.target
       
      [Install]
      WantedBy=multi-user.target
       
      [Service]
      User=mysql
      Group=mysql
      PermissionsStartOnly=true
      ExecStartPre=/usr/share/mysql/mysql-systemd-start pre
      ExecStart=/usr/sbin/mysqld
      ExecStartPost=/usr/share/mysql/mysql-systemd-start post
      TimeoutSec=600
      Restart=on-failure
      RuntimeDirectory=mysqld
      RuntimeDirectoryMode=755
      

      (File can be viewed at https://anonscm.debian.org/cgit/pkg-mysql/mysql.git/tree/debian)

      Should we also in MariaDB have `on-abort`?
      Comments danblack svoj ?

      What about the RuntimeDirectory options MySQL 5.7 used in Debian/Ubuntu, should we have them too?

      RuntimeDirectory=mysqld
      RuntimeDirectoryMode=755
      

      Attachments

        Activity

          danblack Daniel Black added a comment -

          People may choose to change mysqld_safe settings that aren't in /etc/mysql/mariadb.conf.d/50-mysqld_safe.cnf

          I think the postinst should be kept. These will migrate existing explicit settings of mysqld_safe to a systemd equivalent.

          Particularly important is LimitNOFILE/open_files which is 16K by default however a user installation could easily have a higher limit set. An explicit timezone will also need to be migrated to keep the behaviour of MariaDB the same. The other settings are probably less critical however they are only migrated if explicitly set.

          Why install mariadb.conf.d/50-mysqld_safe.cnf anyway since it isn't ever used with systemd as no mysqld_safe section is read?

          danblack Daniel Black added a comment - People may choose to change mysqld_safe settings that aren't in /etc/mysql/mariadb.conf.d/50-mysqld_safe.cnf I think the postinst should be kept. These will migrate existing explicit settings of mysqld_safe to a systemd equivalent. Particularly important is LimitNOFILE/open_files which is 16K by default however a user installation could easily have a higher limit set. An explicit timezone will also need to be migrated to keep the behaviour of MariaDB the same. The other settings are probably less critical however they are only migrated if explicitly set. Why install mariadb.conf.d/50-mysqld_safe.cnf anyway since it isn't ever used with systemd as no mysqld_safe section is read?

          My point was that with current postinst script in upstream MariaDB 10.2 etc sources, everybody will end up with a /etc/systemd/system/mariadb.service.d/migrated-from-my.cnf-settings.conf, even on completely fresh installs. Wasn't this supposed to be just a fall-back? New installs we want to have using systemd defaults instead, right?

          otto Otto Kekäläinen added a comment - My point was that with current postinst script in upstream MariaDB 10.2 etc sources, everybody will end up with a /etc/systemd/system/mariadb.service.d/migrated-from-my.cnf-settings.conf, even on completely fresh installs. Wasn't this supposed to be just a fall-back? New installs we want to have using systemd defaults instead, right?
          danblack Daniel Black added a comment -

          Yes the script is intended to be upgrade from non-systemd version only (at least covered by -f "${systemd_conf}") or migration from MySQL

          danblack Daniel Black added a comment - Yes the script is intended to be upgrade from non-systemd version only (at least covered by -f "${systemd_conf}") or migration from MySQL
          danblack Daniel Black added a comment -

          Restart=on-abort covered in 6346d1de2fda

          Seems like https://github.com/ottok/mariadb-10.1/blame/master/support-files/mariadb.service.in contains exactly the mariadb version.

          Multi-instance fixes are in https://github.com/MariaDB/server/pull/510 for 10.3

          I don't have a good solution mariadb-service-convert to only run on non-systemd converts.

          Anything else that needs to be covered to close this?

          danblack Daniel Black added a comment - Restart=on-abort covered in 6346d1de2fda Seems like https://github.com/ottok/mariadb-10.1/blame/master/support-files/mariadb.service.in contains exactly the mariadb version. Multi-instance fixes are in https://github.com/MariaDB/server/pull/510 for 10.3 I don't have a good solution mariadb-service-convert to only run on non-systemd converts. Anything else that needs to be covered to close this?
          danblack Daniel Black added a comment -

          all seems to be fixed in MDEV-10382

          danblack Daniel Black added a comment - all seems to be fixed in MDEV-10382

          People

            cvicentiu Vicențiu Ciorbaru
            otto Otto Kekäläinen
            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.