Bug #41998 Solaris 10 postinstall script fails to copy from wrong dir
Submitted: 9 Jan 14:32 Modified: 21 Aug 14:07
Reporter: Jonas Sundin
Status: Closed
Category:Server: Packaging Severity:S2 (Serious)
Version:6.3.20,7.0.6 OS:Sun Solaris (Solaris 10 10/08 s10x_u6wos_07a X86)
Assigned to: Jonathan Perkin Target Version:5.1+
Tags: Contribution
Triage: Triaged: D1 (Critical)

[9 Jan 14:32] Jonas Sundin
Description:
Trying to install mysql-cluster-gpl-6.3.20-solaris10-x86_64.pkg in a global zone on
Solaris fails with:

[ verifying class <none> ]
## Executing postinstall script.
/var/sadm/pkg/mysql-cluster/install/postinstall: /opt/mysql/mysql: does not exist
cp: cannot access /opt/mysql/mysql/support-files/mysql.server.in
pkgadd: ERROR: postinstall script did not complete successfully

Installation of <mysql-cluster> failed.

mysql.server.in can be found in /opt/mysql/mysql-cluster/support-files/ and not
/opt/mysql/mysql/support-files/

How to repeat:
bash-3.00# pkgadd -G -d mysql-cluster-gpl-6.3.20-solaris10-x86_64.pkg

Suggested fix:
Update directory information.
[3 May 13:25] Joachim Worringen
This bug is very annoying because it breaks every install, it is trivial to fix, and
should show up with every release test of the pkg.

I wonder why it then persists with MySQL cluster 6.4 and 7.0.5 packages (the latest I
just tested)!?
[3 May 13:28] Joachim Worringen
Just in case: here is the fix.

--- postinstall.orig    Sun May  3 14:24:29 2009
+++ postinstall Sun May  3 14:24:42 2009
@@ -20,7 +20,7 @@
 # is not the same thing. The default pkgadd base directory is /opt/mysql,
 # the MySQL one "/opt/mysql/mysql".

-mybasedir="$basedir/mysql"
+mybasedir="$basedir/mysql-cluster"
 mystart1="$mybasedir/support-files/mysql.server"
 myinstdb="$mybasedir/scripts/mysql_install_db"
 mystart=/etc/init.d/mysql
[15 Jun 17:13] Lars Heill
Affects all versions of mysql-cluster SVR4 packages.
[13 Jul 11:18] Joerg Bruehe
Applied a fix coded by Jonathan to the ongoing cluster-6.3.25 build.
[13 Jul 16:13] Jørgen Austvik
I have verified this fix in these packages:
mysql-cluster-gpl-6.3.25-solaris10-x86_64.pkg

On OpenSolaris:
SunOS khepri02 5.11 snv_117 i86pc i386 i86pc

This is the relevant output of the package install:

-----------8<----------------8<----------------8<----------------8<-----
/usr/sbin/mysqld_safe <symbolic link>
/usr/sbin/mysqlmanager <symbolic link>
/usr/sbin/ndb_mgmd <symbolic link>
/usr/sbin/ndbd <symbolic link>
/usr/sbin/safe_mysqld <symbolic link>
[ verifying class <none> ]
## Executing postinstall script.
090713 16:09:43 [Warning] Forcing shutdown of 3 plugins
090713 16:09:43 [Warning] Forcing shutdown of 3 plugins

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:

/opt/mysql/mysql/bin/mysqladmin -u root password 'new-password'
/opt/mysql/mysql/bin/mysqladmin -u root -h khepri02 password 'new-password'

Alternatively you can run:
/opt/mysql/mysql/bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.

See the manual for more instructions.
-----------8<----------------8<----------------8<----------------8<-----
[18 Aug 12:58] Jonathan Perkin
Patch verified to work, set for documenting.
[20 Aug 14:33] Jon Stephens
Set category to Cluster so this will appear in my queue rather than MC's.
[21 Aug 7:03] Jon Stephens
Please indicate version(s) in which the fix appears. (I'm guessing NDB-6.3.26 and
NDB-7.0.7, but I'm not really supposed to guess.)

Also, does the bug/fix appear in the telco-6.2 tree? If the bug is present in 6.2, I
recommend that the fix be applied there also.

Thanks!
[21 Aug 8:51] Jonathan Perkin
Hi Jon,

This was a fix to internals, so will be applied to any subsequent Cluster release.  Joerg
ensured it was available for 6.3.25, so it appears there, will appear in 7.0.7, and will
be in any future 6.2 build.
[21 Aug 10:54] Jon Stephens
Thanks for the info!
[21 Aug 14:07] Jon Stephens
Documented bugfix in the NDB-6.2.19, 6.3.25, and 7.0.7 changelogs, as follows:

      The pkg installer for MySQL Cluster on Solaris did not perform a 
      complete installation due to an invalid directory reference in the 
      post-install script.
[21 Aug 14:12] Jon Stephens
Set category back to Packaging per my previous comment.

(Changelog entry is tagged for both Cluster and Packaging highlighting.)