Bug in Mac OS X 10.3.7

After struggling for hours with trying to get MySQL running on three different machines, I came across this life-saving forum thread which made me look at the most obvious culprit, file permissions of /tmp.

My bug report to Apple:

BIG PROBLEM - /tmp has wrong permissions

I think the 10.3.7 update is responsible for this. On my G5, before AND after repairing disk permissions:

$ ls -l / |grep tmp
drwx—— 9 john staff 306 5 Feb 16:30 tmp/

On a pismo, again before AND after repairing disk permissions:

$ ls -l / |grep tmp
lrwxr-xr-x 1 root admin 11 29 Jan 20:54 tmp -> private/tmp

/tmp should of course be rwxrwxrwx

Thanks,
John

25 Responses to “Bug in Mac OS X 10.3.7”


  1. 1 Michele

    But how do you change the permissions on /tmp? if I try chmod it will change permission on private/tmp
    Thanks, michele.

  2. 2 JJB

    It’s funny, I was just struggling with this today on a different machine. It seems that OS X has a certain way of dealing with symlinks to directories, where the link has certain fixed permissions and the directory has its own permissions which effectively become the permissions of the link (I don’t know if this is common with other systems). I couldn’t get /tmp to be writable by group and others, but I could get /private/tmp writable by group and others. And after I did that, everything worked just fine.

    It might have something to do with the sticky bit… someone (I can’t remember where I saw this) was commenting on /tmp traditionally having the sticky bit turned on, for increased security.

  3. 3 Jason Vance

    Believe it or not, I found the solution to this after searching for hours:

    Do this:
    cd /tmp
    sudo chmod 1777 .

    As soon as I did that, It works!

  4. 4 JJB

    yep. also i think this all happened because some 3rd party software broke the /tmp -> /private/tmp symlink. so you can re-create that link if you feel so inclinded. do this right after a reboot, and then reboot right after you do it.

    sudo rm -rf /tmp
    sudo ln -s /private/tmp /tmp

  5. 5 noah tsutsui

    you are my god for posting the linking tip. seriously.

  6. 6 JJB

    I’m glad you found it helpful.

    BTW, to see if your symlink is there, do this

    ls -F / | grep tmp

    If you see /tmp -> /private/tmp, then your symlink is just fine. now you just need to make sure that the permissions are correct on /private/tmp. you can do this as mentioned above, with

    sudo chmod 1777 /private/tmp

  7. 7 brian

    Thanks, removing the tmp dir and applying the sym link worked perfectly

  8. 8 Eric Nentrup

    Hmmm….I feel SO close. Having a pretty low-degree of self confidence in the Terminal, I feel I need things VERY MUCH spelled out for me. When I “ls -la”, the “tmp -> /private/tmp” still shows a permission of “lrwxr-xr-x”. I can’t seem to get it to change, therefore I have NO CLUE if this is going to solve my problem!

  9. 9 Eric Nentrup

    Okay… a bit more description…I get CLOSE to getting the server running….and then it STOPS on my after a few seconds. I don’t understand that.

    Eric-Nentrups-PowerMac:/usr/local/mysql ericnentrup$ Starting mysqld daemon with databases from /usr/local/mysql/data
    STOPPING server from pid file /usr/local/mysql/data/Eric-Nentrups-PowerMac.local.pid
    050304 12:35:31 mysqld ended

    And so as far as I can tell, because it STOPS (for whatever reason) I can’t continue on with my setup.

    Thoughts?

  10. 10 JJB

    Try:

    sudo chmod 1777 /private/tmp

  11. 11 stephen

    so i’ve tried everything on here and done two clean installs and i still get:

    stephen$ Starting mysqld daemon with databases from /usr/local/mysql/data
    bin/mysqld_safe: line 311: /usr/local/mysql/data/.local.err: Permission denied
    rm: /usr/local/mysql/data/.local.pid: Permission denied
    bin/mysqld_safe: line 317: /usr/local/mysql/data/.local.err: Permission denied
    STOPPING server from pid file /usr/local/mysql/data/.local.pid
    tee: /usr/local/mysql/data/.local.err: Permission denied
    050424 00:16:29 mysqld ended
    tee: /usr/local/mysql/data/.local.err: Permission denied

    before and after I chmod 1777 the tmp directory, i have:
    lrwxr-xr-x 1 root wheel 12 24 Apr 00:03 tmp -> /private/tmp

    I’m assuming it should be rwxrwxrwx as described above?
    sudo chmod 1777 /private/tmp doesn’t work, and I still have problems…i’ve tried re-symlinking as you described above and still no luck…i’m sure i’m missing something

  12. 12 stephen

    i don’t know if this is relevant, but it seems like my tmp directory a link to itself so i get:
    stephen:/tmp stephen$ ls
    cs_cache_lock_501 mcx_compositor tmp

    is that normal?

  13. 13 stephen

    sorry :) 1 more piece of information:

    stephen:/ stephen$ ls -F / | grep tmp
    tmp@

    so i don’t get what was expected:
    /tmp -> /private/tmp

  14. 14 stephen

    sorry, a fourth post, and on a month and a half slept page,
    “/usr/local/mysql/data/.local.err: Permission denied”
    should read:
    “/usr/local/mysql/data/stephen.local.err: Permission denied”

  15. 15 stephen

    5th post!
    okay, so i found what was wrong here

    the problem was i was:
    “trying to start mysqld as OS user admin. Normally, only root has the power to make the switch to user mysql called for by –user=mysql. Thus, mysqld starts running as user admin, who has no permission to touch data files owned by mysql. Try
    sudo bin/mysqld_safe –user=mysql –log ”

    sorry to clutter the page

  16. 16 taralyn

    thanks so much. i googled ur page and the solution was EXACTLY what i needed. heh. my colleague was trying to solve the problem for days and gave up! :)

  17. 17 Alan Eshelman

    man, none of this stuff helps me with my MySQL problem. I can’t get the thing running at all, i keep getting :

    Starting mysqld daemon with databases from /usr/local/mysql/data
    STOPPING server from pid file /usr/local/mysql/data/G5.local.pid
    050526 20:05:29 mysqld ended

    I’ve tried two different packages and 2 or 3 different ways to install/launch with no help.

    FUnny thing is, i had it running last night but hosed my users up badly and couldn’t log in so i nuked the install. From that point on, no go. Bummage.

  18. 18 Chris More

    Hiya

    I wrestled with this same problem for hours. After following dozens of threads and trying all solutions above to no avail, when I eventually did get it working, I’m not even sure how I did it. For a start, downgrading to PHP 4.0.24 might have helped (restarting after wiping the old version, then again after new install).

    I thought I’d paste my last few steps below in the hope that anyone suffering like I was will be able to follow the same steps:

    lepadouen:/usr/local/mysql root# ./bin/mysqld_safe
    Starting mysqld daemon with databases from /Library/MySQL/var
    STOPPING server from pid file /Library/MySQL/var/lepadouen.plus.com.pid
    050523 22:31:49  mysqld ended
    
    lepadouen:/usr/local/mysql root# sudo chown -R mysql data/
    lepadouen:/usr/local/mysql root# sudo echo
    
    lepadouen:/usr/local/mysql root# ./bin/mysqld_safe &
    [1] 573
    lepadouen:/usr/local/mysql root# Starting mysqld daemon with databases from /Library/MySQL/var
    STOPPING server from pid file /Library/MySQL/var/lepadouen.plus.com.pid
    050523 22:32:59  mysqld ended
    
    #http://www.mysql.com
    Support MySQL by buying support/licenses at https://order.mysql.com
    
    lepadouen:/usr/local/mysql root# sudo echo                       
    
    lepadouen:/usr/local/mysql root# /Library/MySQL/bin/mysqld_safe &
    [1] 608
    lepadouen:/usr/local/mysql root# Starting mysqld daemon with databases from /usr/local/mysql/var
    STOPPING server from pid file /usr/local/mysql/var/127.0.0.1.pid
    050523 22:35:21  mysqld ended
    
    sudo chown -R mysql data/
    [1]+  Done                    /Library/MySQL/bin/mysqld_safe
    lepadouen:/usr/local/mysql root#
    lepadouen:/usr/local/mysql root# /Library/MySQL/bin/mysqld_safe &
    [1] 627
    lepadouen:/usr/local/mysql root# Starting mysqld daemon with databases from /usr/local/mysql/var
    

    Hope that helps?

  19. 19 Chad Criswell

    I worked on this for at least four hours. Finally, in one last effort I downloaded an earlier version of the MySQL installer, deleted all the old mysql files and folders, and installed the previous version. I still had to chown the directories to mysql, but after that it worked perfectly…

  20. 20 DT

    I had the same exact problem as Alan. It all worked last night, but then I couldn’t sign in to my databases in the morning. So I deleted the package, tried to reinstall, but am now having the problem everyone else is.

  21. 21 john

    Remember to try the installation advice on http://www.entropy.ch/software/macosx/mysql/, in the “Database Re-Initialization” section.

  22. 22 Jeremy

    I just wanted to thank everyone for posting these helps! This issue was driving me nuts on my Powerbook!

    Cheers!

  23. 23 Michael

    OK. This thread has been helpful but the best resource for solving this glitch (under 10.4.4) is:

    http://docs.info.apple.com/article.html?artnum=302977

    See the section for ‘Self-Installed MySQL’: although the article is about OS X Server the issue is the same for ) OS 10.4.4.

  24. 24 Anonymous

    son of a…

    wish i’d found this sooner.

    cd /tmp
    sudo chmod 1777 .

    thanks.

  25. 25 lambert strether

    This awesome thread solved my problem, which is that Apache wasn’t starting:

    I’m running Mac OS X server 10.4.9 but with Apache 1.3, starting everything from the command line (bypassing the Apple GUI). This worked great until I just installed an Apple upgrade. apachectl start would seem to work, but ps -aux would show no process and apachectl stop would complain about a missing PID file. httpd -t and apachectl configtest showed the system was configured as expected (and no syntax errors).

    cd /tmp
    sudo chmod 1777 .

    followed by an immediate reboot started apache right up. Thanks!

  1. 1 Agile Tortoise » Bum permissions on /tmp and MySQL startup

Leave a Reply




Close
Powered by ShareThis
All of mp3