Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

It's been a couple of days I am reading these errors in the system log file.

25/11/11 21:31:43,373 com.apple.launchd: (com.apple.launchd.peruser.32697[92747]) getpwuid("32697") failed
25/11/11 21:31:43,374 com.apple.launchd: (com.apple.launchd.peruser.32697[92747]) Exited with code: 1
25/11/11 21:31:43,374 com.apple.launchd: (com.apple.launchd.peruser.32697) Throttling respawn: Will start in 10 seconds

I have OSX Lion 10.7.2.
These message go over and over every few seconds, I've goggled getpwuid() and it seems to be a system call.
I have also read some superuser posts about this issue:
http://superuser.com/search?q=com.apple.launchd.peruser
but running the reported commands in the console did not gave me any hint on how to solve this problem.

I've traced back the first appearance of this error to the 20th of November, here are the previous lines of the system.log file:

Nov 20 17:22:10 MacBook-Pro com.apple.backupd[45360]: Deleted /Volumes/Time Machine/Backups.backupdb/MacBook Pro/2011-11-18-215307 (64.9 MB)
Nov 20 17:22:26 MacBook-Pro com.apple.backupd[45360]: Deleted /Volumes/Time Machine/Backups.backupdb/MacBook Pro/2011-11-18-205448 (88.3 MB)
Nov 20 17:22:26 MacBook-Pro com.apple.backupd[45360]: Post-back up thinning complete: 5 expired backups removed
Nov 20 17:22:28 MacBook-Pro com.apple.backupd[45360]: Backup completed successfully.
Nov 20 17:23:47 MacBook-Pro iCal[45376]: ServerNotifications: Setting delegate to APSD
Nov 20 17:23:47 MacBook-Pro iCal[45376]: ServerNotification: configureService called with nil password
Nov 20 17:23:55 MacBook-Pro iCal[45376]: Subscription request completed
Nov 20 17:28:47 MacBook-Pro com.apple.launchd[1] (com.apple.launchd.peruser.32697[45390]): getpwuid("32697") failed
Nov 20 17:28:47 MacBook-Pro com.apple.launchd[1] (com.apple.launchd.peruser.32697[45390]): Exited with code: 1
Nov 20 17:28:47 MacBook-Pro com.apple.launchd[1] (com.apple.launchd.peruser.32697): Throttling respawn: Will start in 10 seconds    

After this there are (really) tons of messages of this kind.

Do anyone have any hint?

share|improve this question
    
Did you recently delete a user account from your machine? What happens when you open terminal and enter touch foo ; sudo chown 32697 foo ; ls -l foo? –  Daniel Beck Nov 25 '11 at 21:09
    
    
What is the output of sudo launchctl bstree -j, does it contain a line with com.apple.launchd.peruser.32697? What are the child elements? –  Daniel Beck Nov 25 '11 at 21:14
    
the output of touch foo ; sudo chown 32697 foo ; ls -l foo is: touch: foo: Permission denied and then: -rw-r--r-- 1 32697 staff 0 26 Nov 11:55 foo –  nick2k3 Nov 26 '11 at 10:56
    
OK, so that user ID doesn't exist on your system. launchctl would be interesting though. –  Daniel Beck Nov 26 '11 at 10:57

1 Answer 1

up vote 10 down vote accepted

Per-user launchd job overrides (e.g. which per-user jobs are disabled for a user) are located in subdirectories of /private/var/db/launchd.db/, e.g. com.apple.launchd.peruser.501.

Open Terminal and see who owns this directory:

ls -ld /private/var/db/launchd.db/com.apple.launchd.peruser.32697

If the owner (third column) is not a user name, but a numeric ID, that user does not (any longer) exist on your system.

You can just remove that directory and be done with it. If there are special rules in the overrides.plist, it might help you understand the origin of that user and the launchd jobs.


To find out when that launchd per-user directory was created, enter

stat /private/var/db/launchd.db/com.apple.launchd.peruser.32697

It's the last (fourth) date printed.


To find all files on your system not owned by a known user, enter

find / -nouser -ls

If 32697 is not a user on your system (no user name), this might give you some information (e.g. files related to a particular application you installed could mean that application messed with your user settings)

share|improve this answer
    
"Per-user launchd job overrides (e.g. which per-user jobs are disabled for a user) are located in subdirectories of /private/var/db/launchd.db/, e.g. com.apple.launchd.peruser.501." can you explain this? any documentation on launched job overrides? –  nick2k3 Nov 27 '11 at 20:02
    
@nick From man launchctl: -w Overrides the Disabled key and sets it to false. In previous versions, this option would modify the configuration file. Now the state of the Disabled key is stored elsewhere on-disk.. /.../launchd.db is "elsewhere". If you force load/unload a per-user job, it doesn't modify the file used by all accounts (would be kind of stupid to impose your preferences on others on a multi-user system). And that directory is where they're stored instead, but only if customized (e.g. running a disabled by default job or vice versa). It's not really a vital preference. –  Daniel Beck Nov 27 '11 at 20:31
    
Ok, thank you very much for your explanation! –  nick2k3 Nov 28 '11 at 9:35
6  
In addition to removing the directory, you'll want to kill the job from launchd -- sudo launchctl stop com.apple.launchd.peruser.32697, sudo launchctl unload com.apple.launchd.peruser.32697, sudo launchctl remove com.apple.launchd.peruser.32697 –  Doug Harris Jan 13 '12 at 16:06
    
Thanks Doug, the last set of three commands stop that command from constantly running. –  hobs Feb 19 '12 at 15:29

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.