Hi, Rich! On Jan 28, Rich Prohaska wrote:
Hello Sergei,
Mixed results when just using CMAKE_PACKAGING_INSTALL_PREFIX to build Mariadb RPMs with a non-default install prefix.
Good news: the installed files use the supplied install prefix instead of /usr.
Bad news: the server post install script blew up and killed my
Ouch! Were you able to fix the onwership back?
machine. It did "chown -R mysql /" by mistake. The problem is caused by %{_sbindir} not being set to the new install directory. I hacked the post install script to print some debug info.
running expr : / expr: syntax error sbindir=/usr/sbin bindir=/usr/bin basedir= datadir=
As you can see, the expr command is run with a null datadir, which happens because /usr/sbin/mysqld does not exist, which happens because the _sbindir variable is "/usr/sbin" rather than CMAKE_PACKAGING_INSTALL_PREFIX/sbin. Any ideas how to fix this?
First, it's CPACK_PACKAGING_INSTALL_PREFIX not CMAKE_PACKAGING_INSTALL_PREFIX. I hope that's what you used, and it's a typo in the email. Second, I'll soon fix the postinstall script to have some basic consistency checks on basedir/datadir before chown. It's https://mariadb.atlassian.net/browse/MDEV-4068 And third, I've created a patch that is supposed (as far as I've tested) to fix this issue. I'll push it in a few days. Note that after this patch, you're supposed to set CMAKE_INSTALL_PREFIX, not CMAKE_PACKAGING_INSTALL_PREFIX. Like cmake . -DRPM=toku -DCMAKE_INSTALL_PREFIX=/opt Regards, Sergei