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

use environment file in systemd units for _WSREP_*

Details

    Description

      We used to run systemctl set-environment to pass _WSREP_START_POSITION. This is bad because:

      • it clutter systemd's environment (yes, pid 1) - upsets some Debian people dbz 984996
      • it requires root privileges - hence it will fix MDEV-14707, as such it cases all ExecStartPre scripts to be run as root. PermissionsStartOnly was deprecated by systemd in 2018.
      • options (like LimitNOFILE=) are not applied to ExecStartPre scripts.

      The solution is:

      Let's just create an environment file in ExecStartPre=, that is read before ExecStart= kicks in. We have _WSREP_START_POSITION around for the main process without any downsides.

      Attachments

        Issue Links

          Activity

            anel Anel Husakovic created issue -
            serg Sergei Golubchik made changes -
            Field Original Value New Value
            Labels systemd
            serg Sergei Golubchik made changes -
            Fix Version/s 10.4 [ 22408 ]
            Fix Version/s 10.3 [ 22126 ]
            serg Sergei Golubchik made changes -
            Assignee Axel Schwenke [ axel ]
            danblack Daniel Black made changes -
            axel Axel Schwenke made changes -
            Assignee Axel Schwenke [ axel ] Daniel Black [ danblack ]
            serg Sergei Golubchik made changes -
            Workflow MariaDB v3 [ 95268 ] MariaDB v4 [ 141249 ]
            danblack Daniel Black made changes -
            danblack Daniel Black made changes -
            TheLinuxJedi Andrew Hutchings (Inactive) made changes -
            Fix Version/s 10.4.31 [ 29010 ]
            Fix Version/s 10.4 [ 22408 ]
            Resolution Fixed [ 1 ]
            Status Open [ 1 ] Closed [ 6 ]
            TheLinuxJedi Andrew Hutchings (Inactive) made changes -
            Resolution Fixed [ 1 ]
            Status Closed [ 6 ] Stalled [ 10000 ]
            TheLinuxJedi Andrew Hutchings (Inactive) made changes -
            Fix Version/s 10.4.31 [ 29010 ]
            serg Sergei Golubchik made changes -
            Fix Version/s 10.4 [ 22408 ]
            Fix Version/s 10.5 [ 23123 ]
            danblack Daniel Black made changes -
            Status Stalled [ 10000 ] In Review [ 10002 ]
            danblack Daniel Black made changes -
            Description We used to run systemctl set-environment to pass _WSREP_START_POSITION. This is bad because:

            * it clutter systemd's environment (yes, pid 1) - upsets some Debian people [dbz 984996|https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=984996]
            * it requires root privileges - hence it will fix MDEV-14707, as such it cases all ExecStartPre scripts to be run as root. {{PermissionsStartOnly}} was [deprecated by systemd in 2018|https://github.com/systemd/systemd/pull/10802#issuecomment-439446299].
            * options (like LimitNOFILE=) are not applied to ExecStartPre scripts.

            The solution is:

            Let's just create an environment file in ExecStartPre=, that is read before ExecStart= kicks in. We have _WSREP_START_POSITION around for the main process without any downsides.
            danblack Daniel Black made changes -
            Status In Review [ 10002 ] In Testing [ 10301 ]
            danblack Daniel Black made changes -
            Fix Version/s 11.4 [ 29301 ]
            Fix Version/s 10.4 [ 22408 ]
            Fix Version/s 10.5 [ 23123 ]
            danblack Daniel Black made changes -
            Assignee Daniel Black [ danblack ]
            danblack Daniel Black made changes -
            Assignee Daniel Black [ danblack ]
            danblack Daniel Black made changes -
            Status In Testing [ 10301 ] Stalled [ 10000 ]
            danblack Daniel Black made changes -
            Fix Version/s 11.6 [ 29515 ]
            Fix Version/s 11.4 [ 29301 ]
            TheLinuxJedi Andrew Hutchings (Inactive) made changes -
            Fix Version/s 11.6.0 [ 29839 ]
            Fix Version/s 11.6 [ 29515 ]
            Resolution Fixed [ 1 ]
            Status Stalled [ 10000 ] Closed [ 6 ]
            danblack Daniel Black made changes -

            People

              danblack Daniel Black
              anel Anel Husakovic
              Votes:
              1 Vote for this issue
              Watchers:
              8 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.