Bug #57099 False permissions of MySQL StartupItem on MacOSX prevent launchd to start MySQL
Submitted: 29 Sep 2010 12:38 Modified: 13 Dec 2016 13:50
Reporter: Sierk Bornemann Email Updates:
Status: Unsupported Impact on me:
None 
Category:MySQL Server: Installing Severity:S2 (Serious)
Version:5.5.5-m3, 5.5.6 rc, 5.5.8, 5.5.9 OS:MacOS
Assigned to: Assigned Account CPU Architecture:Any
Tags: leopard, snow leopard, startup

[29 Sep 2010 12:38] Sierk Bornemann
Description:
After installing via the package installer and logout/reboot, the following error message of launchd occurs.

launchd fails to load/execute MySQLCOM StartupItem because of false permissions. GUI message appears, which says that. And log message is filed:

18.09.10 11:52:22	SystemStarter[35]	"/Library/StartupItems/MySQLCOM/MySQLCOM" failed security check: not owned by GID 0
18.09.10 12:00:45	SystemStarter[35]	"/Library/StartupItems/MySQLCOM/MySQLCOM" failed sanity check: path was created after boot up

Looking into the MySQLCOM StartupItem reveals:

$ ls -l /Library/StartupItems/MySQLCOM/

-rwxr-xr-x  1 root  staff  1300 13 Sep 13:42 MySQLCOM
-rw-r--r--  1 root  staff   472 13 Sep 13:42 StartupParameters.plist

Why is the MySQL installer installing these two items with GID "staff" instead of GID "wheel"?

How to repeat:
Install the binary package mysql-5.5.3-osx10.6-x86_64 or mysql-5.5.6-rc-osx10.6-x86_64.dmg. Logout, Login or restart.

Suggested fix:
Change the group (GID) from "staff" to "wheel":

$  sudo chown :wheel MySQLCOM 
$  sudo chown :wheel StartupParameters.plist

$ ls -l /Library/StartupItems/MySQLCOM/
-rwxr-xr-x  1 root  wheel  1300 13 Sep 13:42 MySQLCOM
-rw-r--r--  1 root  wheel   472 13 Sep 13:42 StartupParameters.plist
[17 Dec 2010 14:43] Crystal Walters
Tried doing what you suggested. Still get the same error. There must be something deeper at work here.
[31 Dec 2010 8:10] Tjerk Smits
First I applied the changes described above but the error at boot time came back. After changing the owner of the directory MySQLCOM MySQL started at boot without an error.
$  sudo chown :wheel /Library/StartupItems/MySQLCOM
[1 Feb 2011 4:11] Valeriy Kravchuk
Please, check if the same problem still happens with a newer version, 5.5.8.
[1 Feb 2011 13:56] Sierk Bornemann
The Issue is still there on MySQL 5.5.8 GA (mysql-5.5.8-osx10.6-x86_64.dmg).
I've just updated the version information of this bug to reflect that.
[1 Feb 2011 15:18] Sierk Bornemann
Concerning mysql-5.5.8-osx10.6-x86_64:

The directory's group ID "wheel" /Library/StartupItems/MySQLCOM/ on my installation has been a relict of a previous manual correction done by myself.

To have a proper situation, I've completely removed /Library/StartupItems/MySQLCOM/ and then installed MySQLStartupItem.pkg again.

Result:

$ ls -l /Library/StartupItems/
total 0
drwxr-xr-x  4 root  staff  136  3 Dez 19:53 MySQLCOM

and

$  ls -l /Library/StartupItems/MySQLCOM/
total 16
-rwxr-xr-x  1 root  staff  1300  3 Dez 19:53 MySQLCOM
-rw-r--r--  1 root  staff   469  3 Dez 19:53 StartupParameters.plist

A look into the MySQLStartupItem.pkg package with Pacifist confirms that:

drwxr-xr-x  4 root  staff  136  3 Dez 19:53 MySQLCOM
-rwxr-xr-x  1 root  staff  1300  3 Dez 19:53 MySQLCOM
-rw-r--r--  1 root  staff   469  3 Dez 19:53 StartupParameters.plist

I think, a proper

sudo chown -R :wheel /Library/StartupItems/MySQLCOM

done by the installer script of the MySQLStartupItem.pkg package should do what should be done.
[9 Feb 2011 18:33] Valeriy Kravchuk
This is still broken in 5.5.9:

macbook-pro:5.5 openxs$ ls -l /Library/StartupItems/
total 0
drwxr-xr-x  4 root  owner  136 20 січ 22:15 MySQLCOM
drwxr-xr-x  5 root  wheel  170 31 жов 22:03 VirtualBox
macbook-pro:5.5 openxs$ ls -l /Library/StartupItems/MySQLCOM/
total 16
-rwxr-xr-x  1 root  owner  1300 20 січ 22:15 MySQLCOM
-rw-r--r--  1 root  owner   469 20 січ 22:15 StartupParameters.plist
[9 Feb 2011 18:43] Valeriy Kravchuk
Bug #57790 was marked as a duplicate of this one.
[13 Dec 2016 13:50] Erlend Dahl
[13 Dec 2016 1:31] Yngve Svendsen

MacOS packaging was reimplemented for 5.6 upwards in 2014/15. We are not
observing these issues with the new packages, I am thus closing this now.