Bug #31052 PKG Install on Solaris creates temporary files that are not deleted
Submitted: 17 Sep 2007 10:39 Modified: 13 Apr 2009 23:30
Reporter: MC Brown Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Packaging Severity:S3 (Non-critical)
Version:5.0.56 OS:Solaris
Assigned to: Joerg Bruehe CPU Architecture:Any

[17 Sep 2007 10:39] MC Brown
Description:
When installing using pkgadd on Solaris, the mysql_install_db script is generated in the scripts directory, but the temporary files used during the process are there as well.

bash-3.00$ ll scripts/
total 88
drwxr-xr-x   2 root     bin          512 Sep 17 11:14 .
drwxr-xr-x  14 root     bin          512 Sep 17 11:14 ..
-rwxr-xr-x   1 root     bin        14128 Sep 15 00:36 mysql_install_db
-rw-r--r--   1 root     bin        14142 Sep 15 11:04 mysql_install_db.in
-rwxr-xr-x   1 root     bin        14128 Sep 15 00:36 mysql_install_db.old.759

How to repeat:
Install Mysql from the .PKG file

Suggested fix:
The files should be deleted.
[17 Sep 2007 10:41] MC Brown
If you do a pkgadd and then immediately do a pkgrm the following files are left on the system: 

ll /opt/mysql/mysql/*
/opt/mysql/mysql/scripts:
total 28
-rwxr-xr-x   1 root     bin        14128 Sep 15 00:29 mysql_install_db.old.1174*

/opt/mysql/mysql/support-files:
total 22
-rwxr-xr-x   1 root     bin        11216 Sep 15 00:29 mysql.server.old.1174*

And:

ll /opt/mysql/mysql/*
/opt/mysql/mysql/scripts:
total 28
-rwxr-xr-x   1 root     bin        14128 Sep 15 00:29 mysql_install_db.old.1174*

/opt/mysql/mysql/support-files:
total 22
-rwxr-xr-x   1 root     bin        11216 Sep 15 00:29 mysql.server.old.1174*
[17 Sep 2007 10:42] MC Brown
Sorry, that last paste should have been: 

ll /etc/init.d/mysql.in 
-rw-r--r--   1 root     other      11234 Sep 17 11:35 /etc/init.d/mysql.in
[20 Mar 2008 18:07] Kolbe Kegel
Whether or not you execute pkgrm, the /etc/init.d/mysql.in file is left there, and I assume this is the case for the other temporary files.

These files should be removed after the installer is finished using them.
[20 Mar 2008 19:11] Kolbe Kegel
As of 5.0.56, the only file that seems to be left behind is /etc/init.d/mysql.in

That file remains there after pkgadd completes, and it is not removed by pkgrm.

It should ideally be removed as part of the pkgadd post-install so that it doesn't clutter up /etc/init.d/. It should certainly be removed by pkgrm if for some reason it can't be removed earlier.
[27 Mar 2009 12:40] Joerg Bruehe
When checking my bug list and discussing it in the team, I got this reply:

| I fixed this a while back:
| 
|   revno: 108
|   committer: Jonathan Perkin <jperkin@sun.com>
|   branch nick: internals
|   timestamp: Thu 2009-01-08 15:24:44 +0000
|   message:
|     Remove /etc/init.d/mysql.in after use.

The tool tree is not synced with the sources, but checking the archive I found that this fix is contained in the tools used in our versions
- 5.0.76, 5.0.77, and 5.0.79 (but not in 5.0.78 !),
- 5.1.31 and up,
- 6.0.9-alpha and up,
- cluster-6.2.17,
- cluster-6.4.2.

I cannot explain why it wasn't used in 5.0.78, sorry.
It will of course also be used in all future builds.
[13 Apr 2009 23:30] Paul DuBois
Noted in 5.0.77, 5.0.79, 5.1.31, 6.0.9 changelogs.

For installation on Solaris using pkgadd packages, the
mysql_install_db script was generated in the scripts directory, but
the temporary files used during the process were left there and not 
deleted.