• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 264
  • Last Modified:

File is Locked

I am new to Linux - so I have a question.  I updated my aliases file and wanted to re-initialize it but I am getting this message.  Any way to check to see what is wrong?

Alias file /etc/aliases is locked (maybe being rebuilt)

Is someone else in it?  How do I check that?

Thanks for your help
0
suzbara
Asked:
suzbara
2 Solutions
 
paullamhkgCommented:
try ps -aux to see any other process using the file /etc/aliases, or any dead process, if find, kill -9 PID to kill the process and try again.

eg.
USER       PID %CPU %MEM   VSZ   RSS TTY      STAT START   TIME COMMAND
root     19866  0.0     0.5       2640  696  pts/0       R    15:28       0:00 ps -aux

so the PID of the ps -aux is 19866, and if I want to delete these process just 'kill -9 19866' the process of ps -aux will kill and close.

remember you must be the root to do the kill process

so if you kill the process which holding your /etc/aliases, you should able to use it again. remembr to make a backup copy of your /etc/aliases before you kill any process related to /etc/aliases.

Hope this can help
0
 
mbarbosCommented:
You might try using lsof (lsof /etc/aliases would be the command) to find out who is locking the file. And than kill the offender as paullamhkg said.
Try first just a kill, kill -9 might be a bit too drastical to start with.

0
 
suzbaraAuthor Commented:
Thanks guys.  The file was actually released after a bit... but I will keep this for next time!!!

:)  S
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

How do you know if your security is working?

Protecting your business doesn’t have to mean sifting through endless alerts and notifications. With WatchGuard Total Security Suite, you can feel confident that your business is secure, meaning you can get back to the things that have been sitting on your to-do list.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now