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

Get rid of deprecated /var/run paths

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Fixed
    • 5.5(EOL), 10.1(EOL), 10.2(EOL), 10.3(EOL), 10.4(EOL), 10.5
    • 10.5.4
    • None

    Description

      Probably in all distros "/var/run" was migrated to "/run" but you can still find remnants of "/var/run" paths in mariadb files:

      debian/mariadb-server-10.2.postinst
      58:    # This is needed because mysql_install_db removes the pid file in /var/run
      61:    # script fails. I can't tell at this point because of the cleaned /var/run.
      67:    mysql_rundir=/var/run/mysqld
       
      debian/mariadb-server-10.2.mysql.init
      111:    test -e /var/run/mysqld || install -m 755 -o mysql -g root -d /var/run/mysqld
       
      debian/mariadb-server-10.2.logcheck.ignore.server
      2:/etc/init.d/mysql\[[0-9]+\]: Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists\!$
       
      debian/mariadb-server-10.2.logcheck.ignore.paranoid
      1:/etc/init.d/mysql\[[0-9]+\]: Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists\!$
      5:mysqld\[[0-9]+\]: Version: .* socket: '/var/run/mysqld/mysqld.sock'  port: 3306$
       
      debian/mariadb-server-10.2.logcheck.ignore.workstation
      2:/etc/init.d/mysql\[[0-9]+\]: Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists\!$
       
      debian/additions/my.cnf
      20:socket		= /var/run/mysqld/mysqld.sock
      27:socket		= /var/run/mysqld/mysqld.sock
      35:pid-file	= /var/run/mysqld/mysqld.pid
      36:socket		= /var/run/mysqld/mysqld.sock
       
      debian/mariadb-server-10.2.postrm
      70:    rm -rf /var/run/mysqld # this directory is created by the init script, don't leave behind
       
      storage/maria/ma_test_force_start.pl
      57:my $server_pid_name="./var/run/master.pid";
       
      support-files/policy/apparmor/usr.sbin.mysqld
      57:  /var/run/mysqld/mysqld.pid w,
      58:  /var/run/mysqld/mysqld.sock w,
       
      libmariadb/.travis/build/Dockerfile
      66:    	&& rm -rf /var/lib/mysql && mkdir -p /var/lib/mysql /var/run/mysqld \
      67:    	&& chown -R mysql:mysql /var/lib/mysql /var/run/mysqld \
      68:    	&& chmod 777 /var/run/mysqld \
       
      cmake/systemd.cmake
      59:          SET(SYSTEMD_EXECSTARTPRE "ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld")
       
      cmake/install_layout.cmake
      187:SET(INSTALL_UNIX_ADDRDIR_DEB            "/var/run/mysqld/mysqld.sock")
      

      It should be updated to "/run".

      Attachments

        Issue Links

          Activity

            kstreitova Kristyna Streitova created issue -
            kstreitova Kristyna Streitova made changes -
            Field Original Value New Value
            Description Probably in all distros "/var/run" was migrated to "/run" but you can still find remnants of "/var/run" paths in mariadb files:

            debian/mariadb-server-10.2.postinst
            58: # This is needed because mysql_install_db removes the pid file in /var/run
            61: # script fails. I can't tell at this point because of the cleaned /var/run.
            67: mysql_rundir=/var/run/mysqld

            debian/mariadb-server-10.2.mysql.init
            111: test -e /var/run/mysqld || install -m 755 -o mysql -g root -d /var/run/mysqld

            debian/mariadb-server-10.2.logcheck.ignore.server
            2:/etc/init.d/mysql\[[0-9]+\]: Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists\!$

            debian/mariadb-server-10.2.logcheck.ignore.paranoid
            1:/etc/init.d/mysql\[[0-9]+\]: Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists\!$
            5:mysqld\[[0-9]+\]: Version: .* socket: '/var/run/mysqld/mysqld.sock' port: 3306$

            debian/mariadb-server-10.2.logcheck.ignore.workstation
            2:/etc/init.d/mysql\[[0-9]+\]: Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists\!$

            debian/additions/my.cnf
            20:socket = /var/run/mysqld/mysqld.sock
            27:socket = /var/run/mysqld/mysqld.sock
            35:pid-file = /var/run/mysqld/mysqld.pid
            36:socket = /var/run/mysqld/mysqld.sock

            debian/mariadb-server-10.2.postrm
            70: rm -rf /var/run/mysqld # this directory is created by the init script, don't leave behind

            storage/maria/ma_test_force_start.pl
            57:my $server_pid_name="./var/run/master.pid";

            support-files/policy/apparmor/usr.sbin.mysqld
            57: /var/run/mysqld/mysqld.pid w,
            58: /var/run/mysqld/mysqld.sock w,

            libmariadb/.travis/build/Dockerfile
            66: && rm -rf /var/lib/mysql && mkdir -p /var/lib/mysql /var/run/mysqld \
            67: && chown -R mysql:mysql /var/lib/mysql /var/run/mysqld \
            68: && chmod 777 /var/run/mysqld \

            cmake/systemd.cmake
            59: SET(SYSTEMD_EXECSTARTPRE "ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld")

            cmake/install_layout.cmake
            187:SET(INSTALL_UNIX_ADDRDIR_DEB "/var/run/mysqld/mysqld.sock")


            It should be updated to "/run".
            Probably in all distros "/var/run" was migrated to "/run" but you can still find remnants of "/var/run" paths in mariadb files:

            {noformat}
            debian/mariadb-server-10.2.postinst
            58: # This is needed because mysql_install_db removes the pid file in /var/run
            61: # script fails. I can't tell at this point because of the cleaned /var/run.
            67: mysql_rundir=/var/run/mysqld

            debian/mariadb-server-10.2.mysql.init
            111: test -e /var/run/mysqld || install -m 755 -o mysql -g root -d /var/run/mysqld

            debian/mariadb-server-10.2.logcheck.ignore.server
            2:/etc/init.d/mysql\[[0-9]+\]: Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists\!$

            debian/mariadb-server-10.2.logcheck.ignore.paranoid
            1:/etc/init.d/mysql\[[0-9]+\]: Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists\!$
            5:mysqld\[[0-9]+\]: Version: .* socket: '/var/run/mysqld/mysqld.sock' port: 3306$

            debian/mariadb-server-10.2.logcheck.ignore.workstation
            2:/etc/init.d/mysql\[[0-9]+\]: Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists\!$

            debian/additions/my.cnf
            20:socket = /var/run/mysqld/mysqld.sock
            27:socket = /var/run/mysqld/mysqld.sock
            35:pid-file = /var/run/mysqld/mysqld.pid
            36:socket = /var/run/mysqld/mysqld.sock

            debian/mariadb-server-10.2.postrm
            70: rm -rf /var/run/mysqld # this directory is created by the init script, don't leave behind

            storage/maria/ma_test_force_start.pl
            57:my $server_pid_name="./var/run/master.pid";

            support-files/policy/apparmor/usr.sbin.mysqld
            57: /var/run/mysqld/mysqld.pid w,
            58: /var/run/mysqld/mysqld.sock w,

            libmariadb/.travis/build/Dockerfile
            66: && rm -rf /var/lib/mysql && mkdir -p /var/lib/mysql /var/run/mysqld \
            67: && chown -R mysql:mysql /var/lib/mysql /var/run/mysqld \
            68: && chmod 777 /var/run/mysqld \

            cmake/systemd.cmake
            59: SET(SYSTEMD_EXECSTARTPRE "ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld")

            cmake/install_layout.cmake
            187:SET(INSTALL_UNIX_ADDRDIR_DEB "/var/run/mysqld/mysqld.sock")
            {noformat}


            It should be updated to "/run".
            elenst Elena Stepanova made changes -
            Assignee Sergei Golubchik [ serg ]
            elenst Elena Stepanova made changes -
            Fix Version/s 10.2 [ 14601 ]
            faust Faustin Lammler added a comment - Hi serg ! Do yo know if there is any project of moving /var/run to /run? https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch05s13.html https://wiki.debian.org/ReleaseGoals/RunDirectory https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=946825
            serg Sergei Golubchik made changes -
            Priority Major [ 3 ] Minor [ 4 ]
            serg Sergei Golubchik made changes -
            Affects Version/s 5.5 [ 15800 ]
            Affects Version/s 10.1 [ 16100 ]
            Affects Version/s 10.3 [ 22126 ]
            Affects Version/s 10.4 [ 22408 ]
            Affects Version/s 10.5 [ 23123 ]
            serg Sergei Golubchik made changes -
            Fix Version/s 10.3 [ 22126 ]
            Fix Version/s 10.4 [ 22408 ]
            Fix Version/s 10.5 [ 23123 ]

            Yes, we'll move eventually

            serg Sergei Golubchik added a comment - Yes, we'll move eventually

            Some of this was fixed by danblack in b2feb030014f5ff7d71cd55326a93cc709386407 and me in aaaf005ce61a543f1a1470b179ccb535698b36ef and bb8477778b72f047437b2a03a2bd38997e155f10 but there are still occurences of it:

            ± grep -rF var/run *
            cmake/systemd.cmake:          SET(SYSTEMD_EXECSTARTPRE "ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld")
            extra/wolfssl/wolfssl/wnr-example.conf:    working = "/var/run/wnrentropy";
            extra/wolfssl/wolfssl/wnr-example.conf:    socket  = "/var/run/wnrentropy";
            libmariadb/.travis/build/Dockerfile:    	&& rm -rf /var/lib/mysql && mkdir -p /var/lib/mysql /var/run/mysqld \
            libmariadb/.travis/build/Dockerfile:    	&& chown -R mysql:mysql /var/lib/mysql /var/run/mysqld \
            libmariadb/.travis/build/Dockerfile:    	&& chmod 777 /var/run/mysqld \
            mysql-test/mysql-test-run.pl:    # using any pidfiles found in var/run
            mysql-test/main/log_state.test:# i.e var/run
            mysql-test/lib/v1/mtr_process.pl:  # We scan the "var/run/" directory for other process id's to kill
            storage/maria/ma_test_force_start.pl:my $server_pid_name="./var/run/master.pid";
            storage/columnstore/columnstore/oam/oamcpp/liboamcpp.cpp:                    command = "remote_command.sh " + DataRedundancyConfigs[pm].pmIpAddr + " " + password + " 'stat /var/run/glusterd.pid > /dev/null 2>&1'";
            storage/columnstore/columnstore/oam/oamcpp/liboamcpp.cpp:                command = "remote_command.sh " + ipAddress + " " + password + " 'stat /var/run/glusterd.pid > /dev/null 2>&1'";
            storage/columnstore/columnstore/.drone.jsonnet:      path: '/var/run/docker.sock',
            storage/columnstore/columnstore/.drone.jsonnet:  volumes: [pipeline._volumes.mdb { temp: {} }, pipeline._volumes.docker { host: { path: '/var/run/docker.sock' } }],
            storage/columnstore/columnstore/versioning/BRM/script-fcns:	if [ -f /var/run/${base}.pid ]; then
            storage/columnstore/columnstore/versioning/BRM/script-fcns:		read line < /var/run/${base}.pid
            storage/columnstore/columnstore/versioning/BRM/script-fcns:	# First try "/var/run/*.pid" files
            storage/columnstore/columnstore/versioning/BRM/script-fcns:	# First try "/var/run/*.pid" files
            storage/columnstore/columnstore/versioning/BRM/script-fcns:	# Next try "/var/run/*.pid" files
            storage/columnstore/columnstore/versioning/BRM/script-fcns:	 rm -f /var/run/confirm
            support-files/policy/apparmor/usr.sbin.mysqld:  /var/run/mysqld/mysqld.pid w,
            support-files/policy/apparmor/usr.sbin.mysqld:  /var/run/mysqld/mysqld.sock w,
            support-files/mariadb@.service.in:#   Environment=MYSQLD_MULTI_INSTANCE="--socket=/var/run/mysqld/%I.sock \
            

            otto Otto Kekäläinen added a comment - Some of this was fixed by danblack in b2feb030014f5ff7d71cd55326a93cc709386407 and me in aaaf005ce61a543f1a1470b179ccb535698b36ef and bb8477778b72f047437b2a03a2bd38997e155f10 but there are still occurences of it: ± grep -rF var/run * cmake/systemd.cmake: SET(SYSTEMD_EXECSTARTPRE "ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld") extra/wolfssl/wolfssl/wnr-example.conf: working = "/var/run/wnrentropy"; extra/wolfssl/wolfssl/wnr-example.conf: socket = "/var/run/wnrentropy"; libmariadb/.travis/build/Dockerfile: && rm -rf /var/lib/mysql && mkdir -p /var/lib/mysql /var/run/mysqld \ libmariadb/.travis/build/Dockerfile: && chown -R mysql:mysql /var/lib/mysql /var/run/mysqld \ libmariadb/.travis/build/Dockerfile: && chmod 777 /var/run/mysqld \ mysql-test/mysql-test-run.pl: # using any pidfiles found in var/run mysql-test/main/log_state.test:# i.e var/run mysql-test/lib/v1/mtr_process.pl: # We scan the "var/run/" directory for other process id's to kill storage/maria/ma_test_force_start.pl:my $server_pid_name="./var/run/master.pid"; storage/columnstore/columnstore/oam/oamcpp/liboamcpp.cpp: command = "remote_command.sh " + DataRedundancyConfigs[pm].pmIpAddr + " " + password + " 'stat /var/run/glusterd.pid > /dev/null 2>&1'"; storage/columnstore/columnstore/oam/oamcpp/liboamcpp.cpp: command = "remote_command.sh " + ipAddress + " " + password + " 'stat /var/run/glusterd.pid > /dev/null 2>&1'"; storage/columnstore/columnstore/.drone.jsonnet: path: '/var/run/docker.sock', storage/columnstore/columnstore/.drone.jsonnet: volumes: [pipeline._volumes.mdb { temp: {} }, pipeline._volumes.docker { host: { path: '/var/run/docker.sock' } }], storage/columnstore/columnstore/versioning/BRM/script-fcns: if [ -f /var/run/${base}.pid ]; then storage/columnstore/columnstore/versioning/BRM/script-fcns: read line < /var/run/${base}.pid storage/columnstore/columnstore/versioning/BRM/script-fcns: # First try "/var/run/*.pid" files storage/columnstore/columnstore/versioning/BRM/script-fcns: # First try "/var/run/*.pid" files storage/columnstore/columnstore/versioning/BRM/script-fcns: # Next try "/var/run/*.pid" files storage/columnstore/columnstore/versioning/BRM/script-fcns: rm -f /var/run/confirm support-files/policy/apparmor/usr.sbin.mysqld: /var/run/mysqld/mysqld.pid w, support-files/policy/apparmor/usr.sbin.mysqld: /var/run/mysqld/mysqld.sock w, support-files/mariadb@.service.in:# Environment=MYSQLD_MULTI_INSTANCE="--socket=/var/run/mysqld/%I.sock \
            danblack Daniel Black added a comment -

            cmake/systemd.cmake - still hoping for removal - https://github.com/MariaDB/server/pull/1105
            wolffssl - external sub module and its in an example file we don't use
            libmariadb - done - https://github.com/mariadb-corporation/mariadb-connector-c/pull/145
            mysql-test + storage/maria - relative paths to the test var directory so doesn't matter
            storage/columnstore/ - consider writing a MCOL issue for this
            support-files/ - bb-10.5-MDEV-18841-slash-run-support-files-danielblack - not expecting any problems

            danblack Daniel Black added a comment - cmake/systemd.cmake - still hoping for removal - https://github.com/MariaDB/server/pull/1105 wolffssl - external sub module and its in an example file we don't use libmariadb - done - https://github.com/mariadb-corporation/mariadb-connector-c/pull/145 mysql-test + storage/maria - relative paths to the test var directory so doesn't matter storage/columnstore/ - consider writing a MCOL issue for this support-files/ - bb-10.5- MDEV-18841 -slash-run-support-files-danielblack - not expecting any problems
            danblack Daniel Black made changes -
            Component/s Packaging [ 10700 ]
            Component/s Scripts & Clients [ 11002 ]
            Fix Version/s 10.5.4 [ 24264 ]
            Fix Version/s 10.2 [ 14601 ]
            Fix Version/s 10.3 [ 22126 ]
            Fix Version/s 10.4 [ 22408 ]
            Fix Version/s 10.5 [ 23123 ]
            Assignee Sergei Golubchik [ serg ] Daniel Black [ danblack ]
            Resolution Fixed [ 1 ]
            Status Open [ 1 ] Closed [ 6 ]
            danblack Daniel Black made changes -

            faust We still have

            ± grep -rF var/run/m *
            cmake/systemd.cmake:          SET(SYSTEMD_EXECSTARTPRE "ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld")
            storage/maria/ma_test_force_start.pl:my $server_pid_name="./var/run/master.pid";
            

            otto Otto Kekäläinen added a comment - faust We still have ± grep -rF var/run/m * cmake/systemd.cmake: SET(SYSTEMD_EXECSTARTPRE "ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld") storage/maria/ma_test_force_start.pl:my $server_pid_name="./var/run/master.pid";
            faust Faustin Lammler added a comment - - edited

            HI!

            cmake/systemd.cmake
            

            Handled by https://github.com/MariaDB/server/pull/1105, I will see with danblack how to proceed.

            For:

            storage/maria/ma_test_force_start.pl:my $server_pid_name="./var/run/master.pid";
            

            and also:

            mysql-test/lib/v1/mtr_process.pl:  # We scan the "var/run/" directory for other process id's to kill
              my $rundir= "$::opt_vardir/run";
            

            Maybe anel wants to take a look and confirm that it's easy to test that it can easily be changed?

            faust Faustin Lammler added a comment - - edited HI! cmake/systemd.cmake Handled by https://github.com/MariaDB/server/pull/1105 , I will see with danblack how to proceed. For: storage/maria/ma_test_force_start.pl: my $server_pid_name = "./var/run/master.pid" ; and also: mysql-test/lib/v1/mtr_process.pl: # We scan the "var/run/" directory for other process id's to kill my $rundir = "$::opt_vardir/run" ; Maybe anel wants to take a look and confirm that it's easy to test that it can easily be changed?

            danblack is PR #1105 related to this MDEV? If yes should MDEV be open?
            faust mtr creates its own var/ folder related to build-dir, so it's mtr specific folder:

            anel@anel:~/mariadb/builds/10.5/mysql-test$ ls |grep var
            var
            

            anel Anel Husakovic added a comment - danblack is PR #1105 related to this MDEV? If yes should MDEV be open? faust mtr creates its own var/ folder related to build-dir , so it's mtr specific folder: anel@anel:~/mariadb/builds/10.5/mysql-test$ ls |grep var var
            DBrunner Jim Dutton made changes -
            serg Sergei Golubchik made changes -
            Workflow MariaDB v3 [ 93007 ] MariaDB v4 [ 155865 ]
            danblack Daniel Black added a comment -

            > PR #1105 related to this MDEV? If yes should MDEV be open?

            Its the final piece of the cleanup. Given the time passed, make a new MDEV for it 1105.

            danblack Daniel Black added a comment - > PR #1105 related to this MDEV? If yes should MDEV be open? Its the final piece of the cleanup. Given the time passed, make a new MDEV for it 1105.

            Filed this now as MDEV-30874 due to previous comment.

            otto Otto Kekäläinen added a comment - Filed this now as MDEV-30874 due to previous comment.

            People

              danblack Daniel Black
              kstreitova Kristyna Streitova
              Votes:
              0 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.