mysql chowns /usr

When I start mysql, it recursively changes ownership of /usr to mysql:mysql. This problem started after upgrading from 12.3 to 13.1. This causes a lot of problems. Any help for figuring out how to stop this would be greatly appreciated.

~ # ls -l /usr/
total 120
drwxr-xr-x  2 root root 36864 Sep 27  2013 bin
drwxr-xr-x  2 root root  4096 Sep 27  2013 games
drwxr-xr-x 51 root root  4096 Sep 27  2013 include
drwxr-xr-x 46 root root  4096 Jan 26 08:53 lib
drwxr-xr-x 50 root root 36864 Sep 27  2013 lib64
drwxr-xr-x 12 root root  4096 Sep 27  2013 local
-rw-r--r--  1 root root   943 Jan 26 08:47 my.cnf
drwxr-xr-x  2 root root 12288 Sep 27  2013 sbin
drwxr-xr-x 86 root root  4096 Sep 27  2013 share
drwxr-xr-x  3 root root  4096 Sep 27  2013 src
lrwxrwxrwx  1 root root    10 Jan 26 08:53 tmp -> ../var/tmp
drwxr-xr-x  5 root root  4096 Sep 27  2013 X11R6
drwxr-xr-x  5 root root  4096 Sep 27  2013 x86_64-suse-linux
~ # systemctl start mysql.service
~ # ls -l /usr/
total 120
drwxr-xr-x  2 mysql mysql 36864 Sep 27  2013 bin
drwxr-xr-x  2 mysql mysql  4096 Sep 27  2013 games
drwxr-xr-x 51 mysql mysql  4096 Sep 27  2013 include
drwxr-xr-x 46 mysql mysql  4096 Jan 26 08:53 lib
drwxr-xr-x 50 mysql mysql 36864 Sep 27  2013 lib64
drwxr-xr-x 12 mysql mysql  4096 Sep 27  2013 local
-rw-r--r--  1 mysql mysql   943 Jan 26 08:47 my.cnf
drwxr-xr-x  2 mysql mysql 12288 Sep 27  2013 sbin
drwxr-xr-x 86 mysql mysql  4096 Sep 27  2013 share
drwxr-xr-x  3 mysql mysql  4096 Sep 27  2013 src
lrwxrwxrwx  1 mysql mysql    10 Jan 26 08:53 tmp -> ../var/tmp
drwxr-xr-x  5 mysql mysql  4096 Sep 27  2013 X11R6
drwxr-xr-x  5 mysql mysql  4096 Sep 27  2013 x86_64-suse-linux
~ # systemctl stop mysql.service

I reinstall the filesystem package to correct ownership.

~ # zypper in -f filesystem
Loading repository data...
Reading installed packages...
Forcing installation of 'filesystem-13.1-3.1.2.x86_64' from repository 'openSUSE-13.1-Oss'.
Resolving package dependencies...


The following package is going to be reinstalled:
  filesystem 


1 package to reinstall.
Overall download size: 67.7 KiB. No additional space will be used or freed after the operation.
Continue? [y/n/? shows all options] (y): y
Retrieving package filesystem-13.1-3.1.2.x86_64                                                                                                                           (1/1),  67.7 KiB (    0 B unpacked)
Retrieving: filesystem-13.1-3.1.2.x86_64.rpm ..........................................................................................................................................................[done]
(1/1) Installing: filesystem-13.1-3.1.2 ...............................................................................................................................................................[done]
~ # ls -l /usr/
total 120
drwxr-xr-x  2 root  root  36864 Sep 27  2013 bin
drwxr-xr-x  2 root  root   4096 Sep 27  2013 games
drwxr-xr-x 51 root  root   4096 Sep 27  2013 include
drwxr-xr-x 46 root  root   4096 Jan 26 08:54 lib
drwxr-xr-x 50 root  root  36864 Sep 27  2013 lib64
drwxr-xr-x 12 root  root   4096 Sep 27  2013 local
-rw-r--r--  1 mysql mysql   943 Jan 26 08:47 my.cnf
drwxr-xr-x  2 root  root  12288 Sep 27  2013 sbin
drwxr-xr-x 86 root  root   4096 Sep 27  2013 share
drwxr-xr-x  3 root  root   4096 Sep 27  2013 src
lrwxrwxrwx  1 root  root     10 Jan 26 08:54 tmp -> ../var/tmp
drwxr-xr-x  5 root  root   4096 Sep 27  2013 X11R6
drwxr-xr-x  5 root  root   4096 Sep 27  2013 x86_64-suse-linux

~ # zypper lr -u
# | Alias                    | Name                         | Enabled | Refresh | URI                                                                               
--+--------------------------+------------------------------+---------+---------+-----------------------------------------------------------------------------------
1 | Archiving:Backup:Factory | Archiving:Backup:Factory     | Yes     | Yes     | http://download.opensuse.org/repositories/Archiving:/Backup:/Factory/openSUSE_13.1
2 | openSUSE-13.1-Oss        | openSUSE-13.1-Oss            | Yes     | No      | http://download.opensuse.org/distribution/13.1/repo/oss/                          
3 | openSUSE-13.1-Update     | openSUSE-13.1-Update         | Yes     | No      | http://download.opensuse.org/update/13.1/                                         
4 | repo-update-non-oss      | openSUSE-13.1-Update-Non-Oss | Yes     | Yes     | http://download.opensuse.org/update/13.1-non-oss/

~ # rpm -qa | fgrep mysql
mysql-community-server-5.6.12-7.2.2.x86_64
mysql-community-server-errormessages-5.6.12-7.2.2.x86_64
mysql-community-server-client-5.6.12-7.2.2.x86_64
bacula-catalog-mysql-5.2.13-238.3.x86_64
bacula-mysql-5.2.13-238.3.x86_64
libmysqlclient18-5.5.33-2.2.x86_64
php5-mysql-5.4.20-34.3.x86_64

Please pastebin the contents of; /etc/init.d/mysql and /etc/my.cnf - remove any personally identified information such as IP addresses.

You can post them to; http://paste.opensuse.org/ or https://bpaste.net/

The initrd script changes $log_dir variable to mysql.mysql, my guess is you have it set to /usr for some reason or for some reason it picks it.

That would of course be init.d script, not initrd. This is what happens when you do things and write forum posts at the same time :stuck_out_tongue: