Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

A week ago I upgraded to Lion from Snow Leopard. I want to use the locate command, but the locate database has not been built yet. So I tried running

sudo launchctl -w /System/Library/LaunchDaemons/com.apple.locate.plist

The plist file only points to /usr/libexec/locate.updatedb and I keep getting the following error in syslog su: pam_acct_mgmt: error in service module
When I try running locate.updatedb directly I get the same error in syslog.

I could handle not using locate, but what bugs me the most is that I don't know what's causing the issue.

share|improve this question
    
1) I assume you have rebooted and that the account in question is an 'administrator' account. 2) Assuming #1, can you use 'sudo' for other commands, such as 'sudo id'? 3) 'locate' is far less useful in Lion, as even when run by root it only finds 'public' files. –  TJ Luoma Oct 4 '11 at 12:51
    
I have rebooted, my account is in the admin group and sudo works as expected (i.e sudo id returns user identity of root). I know locate is less usefull than for example in linux, I just don't like that it doesn't work. Since I did an upgrade and not a clean install, I don't want any further surprises in the future. –  bing Oct 4 '11 at 13:03
    
I'm the one who edited your text and who just removed the "edit" since it's not relevant to the question. If you're wondering why I can do that, please read the faq. Sorry about the spelling mistake I made. –  Loïc Wolff Oct 4 '11 at 14:13

4 Answers 4

Debugging pam can be tricky.

Have you tried making a real root shell with sudo -s and running the /usr/libexec/locate.updatedb command.

Alternatively, you could try making a new admin account to be sure your admin account has correct privelages/authentication. Any odd things like server or OpenLDAP that we should know of?

share|improve this answer
    
I tried with a root shell (after reading your answer) and the problem persists. In the root shell I just get su: Sorry after running /usr/libexec/locate.updatedb and in syslog I see the same error message again. I created a new account which I added to the admin group, the same error occurs. I'm on a Lion client machine, so no server utilities installed and I don't have OpenLDAP configured. –  bing Oct 4 '11 at 22:21

This seems to work for me.

sudo /usr/libexec/locate.updatedb
share|improve this answer

You can run the command to update the database used by locate directly by calling

sudo /usr/libexec/locate.updatedb 

This will take a while and should refresh the whole index.

share|improve this answer

Check your .bashrc paths. Include /usr/libexec in the $PATH statement if its missing.

share|improve this answer
    
Can you add some details about what this does and how it solves the problem described in the question? –  patrix Jul 13 '13 at 6: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.