[MDEV-18841] Get rid of deprecated /var/run paths Created: 2019-03-06  Updated: 2023-03-18  Resolved: 2020-08-24

Status: Closed
Project: MariaDB Server
Component/s: Packaging, Scripts & Clients
Affects Version/s: 5.5, 10.1, 10.2, 10.3, 10.4, 10.5
Fix Version/s: 10.5.4

Type: Bug Priority: Minor
Reporter: Kristyna Streitova Assignee: Daniel Black
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Blocks
is blocked by MDEV-25737 version 10.3.29 fails to create "/run... Closed
Relates
relates to MCOL-4271 /var/run deprecated in distos in favo... Closed

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



 Comments   
Comment by Faustin Lammler [ 2019-12-23 ]

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

Comment by Sergei Golubchik [ 2019-12-24 ]

Yes, we'll move eventually

Comment by Otto Kekäläinen [ 2020-08-22 ]

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 \

Comment by Daniel Black [ 2020-08-24 ]

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

Comment by Otto Kekäläinen [ 2020-11-22 ]

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

Comment by Faustin Lammler [ 2020-11-23 ]

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?

Comment by Anel Husakovic [ 2020-11-23 ]

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

Comment by Daniel Black [ 2022-03-22 ]

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

Comment by Otto Kekäläinen [ 2023-03-18 ]

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

Generated at Thu Feb 08 08:47:08 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.