Since mysql-4.0.25-r1 emerge mysql reads the data directory from the file /etc/mysql/my.cnf and tries to write files (at least the file .keep) into this directory after compiling and installing mysql. Because I need the same databases both on Linux and Windows my data directory is on a FAT32 partition. So after compiling mysql and installing most of it I'm getting this error message: >>> /usr/include/mysql/m_string.h --- /redmond/ --- /redmond/daten/ --- /redmond/daten/Office/ --- /redmond/daten/Office/MySQL/ --- /redmond/daten/Office/MySQL/data/ !!! Failed to chown/chmod/unlink in movefile() !!! /redmond/daten/Office/MySQL/data/.keep !!! [Errno 1] Operation not permitted: '/redmond/daten/Office/MySQL/data/.keep' After this emerge mysql stops. Of course chown and chmod don't work on FAT32 partitions because FAT32 doesn't have Linux file attributes. And, btw, I don't really like if portage writes anything into my FAT32 partitions or my mysql data dir. A workaround is to unmount the FAT32 partition before installing mysql but this can't be the solution. So it would be great if this problem would be fixed or even better if the data dir was not read from /etc/mysql/my.cnf and there were no files written into this directory by portage. Reproducible: Always Steps to Reproduce: 1. emerge mysql 2. 3.
the .keep is an old controversial thing, see the bug on which this has been marked as duplicate. That directory should be "keeped" on disk also after an unmerge of the package. Another solution could be leave the creation of that dirs to pkg_config(). This one is _not_ called during emerge but manually from the user with the command #ebuild path/to/mysql-[version].ebuild config The latest solution is unacceptable because there are (many?) users that prefere to configure themself the server. Finally the chmod is needed from all application that run under a different user from mysql:mysql *** This bug has been marked as a duplicate of 16162 ***
It's not really a duplicate of 16162. I don't really have anything against the .keep files. In fact I see the sense and the advantage of the .keep files. And if the .keep file is the only file which is written into the mysql data dir by portage then I don't mind about it. The hint about #ebuild path/to/mysql-[version].ebuild config doesn't work either. This is what I get: # ebuild /usr/portage/dev-db/mysql/mysql-4.0.25-r2.ebuild config * MySQL DATADIR is /redmond/daten/Office/MySQL/data * You have already a MySQL database in place. * Please rename it or delete it if you wish to replace it. !!! ERROR: dev-db/mysql-4.0.25-r2 failed. !!! Function pkg_config, Line 358, Exitcode 0 !!! MySQL database already exists! !!! If you need support, post the topmost build error, NOT this status message. The main problem is that chown and chmod don't work on FAT32 and that emerge is aborted when it tries to change the permissions of <mysql-datadir>/.keep and displays the error message I posted first, so that most of the program is installed correctly, I guess, but the remaining installation steps are not done, e.g. updating the world file, uninstalling the older version, updating ld.so.conf etc. There could be a few alternative solutions. I don't know which is realizable by portage. 1. Let portage (emerge) check if the filesystem on which the .keep file is created is a filesystem which can handle the Linux file permissions. If yes (e.g. ext2fs, reiserfs) then run the chown and chmod commands, if not (e.g. FAT32) then don't run these commands. 2. Display the first posted error message only as a warning but not as an error and let portage (emerge) ignore this error message so that it can complete the installation and doesn't abort the installation when this error occurs. Then the user can decide if this is really an error or not after the installation is completed. 3. Let portage (emerge) check if there is already a .keep file in this directory. If yes then don't create a new one and don't change the permissions, if no then create a new one and change the permissions. This implicates that the user gets the error with the first emerge mysql but not with the second one. In this case it couldn't be bad if there was an ewarning (I guess that's the ebuild command) which tells the user to simply install mysql twice if this error occurs. 4. Don't create the .keep file in the mysql data directory as it was in the older mysql ebuilds. I don't speak of the .keep files in general, only of the .keep file for this one directory which, btw, shouldn't be automatically deleted anyway when uninstalling mysql completely. ;-) I don't know, maybe there is another better solution for the FAT32 problem which I can't think of at the moment.
Fixed, following the snip from the ChangeLog: ==== ChangeLog ==== fix bug #99891 if datadir (usually "/var/lib/mysql") is in place don't touch it. Applied to MySQL versions 4.1 and 5.0 this change defer to the user the responsibility to manage his own datadir. ==== ChangeLog ==== it's into these ones. mysql-4.1.13-r1.ebuild mysql-5.0.10_beta.ebuild mysql-5.0.9_beta-r2.ebuild