I was attempting to solve an issue ("/var/log/msmtp.log: permissions denied" error when attempting to send mail using msmtp) when I did this:

> chmod -R 770 /var

After that, my machine would not resolve domain names via cURL. (ping also fails) But, oddly, I can enter domain names into Safari and visit any web pages w/o a problem...

I'm actually not sure if the chmod command is the cause of the problem, but I suspect it is.

Also, if I ls -l on /var (or /private/var) it doesn't seem that any of the subdirectories or files there actually changed permission, but there are many, so I can't say that conclusively...

Incidentally, I fixed the original error (msmtp.log permission denied) by setting TMPDIR=/tmp in my local environment (bash). Now the error goes away, but I get this error:

msmtp: cannot locate host domainname.org: nodename nor servname provided, or not known

Any ideas about how to go about getting DNS working again?

  • 1
    I don't suppose you have a recent backup of your filesystem before you ran chmod? – Zoredache Jun 12 '10 at 9:58

Running chmod -R 700 /var will have made a bunch of important parts of the OS inaccessible to anything but root. You may be able to resurrect things with permissions repair: boot from the Install DVD, select a primary language, then select Disk Utility from the Utilities menu; in Disk Utility, select your HD from the sidebar, then the First Aid tab on the right, then Repair Disk Permissions under that. This may not fix everything back to the way it should be (it doesn't know what the perms should be on all files), but it'll probably get it back to the point where you can boot it.

If it reboots successfully after that, I'd actually run permissions repair again from the booted OS (it'll be using the version of Disk Utility that matches the running OS, and may have a slightly better idea of what the perms should be).


More information...

After doing some checking I found this helpful post on debugging mDNSResponder (the daemon that handles DNS in Snow Leopard) http://www.afp548.com/article.php?story=20100329090657793

Unfortunately, I turned on debugging for mDNSResponder this way:

> sudo killall -USR1 mDNSResponder

I then turned on debugging for syslog:

> sudo syslog -c mDNSResponder -d

At this point other applications like Application Monitor wouldn't load and the system slowed waaay down.

A look at the system.log file showed that the mDNSResponder was indeed having a problem and it seems that the mDNSResponder daemon wasn't able to start and kept looping, sending the same error messages to syslog. I would post the messages, but I can no longer get at the system.log file. (I have attempted to reboot the machine, but it now seems to be hanging or taking > 15 mins to reboot)

Before rebooting I attempted to shut off messages to the system.log file from mDNSResponder by adding this line to /etc/asl.conf:

[= Sender mDNSResponder] ignore

then restarting syslog with:

> sudo killall -HUP syslog

This didn't seem to work, as the messages kept pouring in...

I'm hoping my machine reboots...it seems to be hanging during the reboot process.

Any thoughts about how to proceed? I seem to be digging myself into a deeper hole...


This ended up being a reinstall from backup.

Before doing that, I did boot from the Snow Leopard install DVD and ran the permissions repair from the Disk Utility, to no avail. (Disk Utility didn't seem to find any issues with the permissions on /var or any subdirs) A reboot resulted in the same behavior where the machine was just stuck in the bootup window.

Thanks for everyone's responses!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy