Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 05-13-2004, 03:53 AM   #1
Registered: Apr 2003
Location: denver co
Distribution: redhat9
Posts: 156

Rep: Reputation: 30
no pid file in /var/run for programs

So, a long time ago I noticed that some if not most of my services were not running, I just read a book on scripts in bash and learned a little. Well here is what I have figured out and what I have not had so much fortune in. I do a service --status-all and I get

anacron dead but subsys locked
apmd dead but subsys locked
arpwatch is stopped
atd dead but subsys locked
Configured Mount Points:

Active Mount Points:
cannaserver is stopped
cpqarrayd is stopped
crond dead but subsys locked
oh shit
cupsd is stopped
gpm is stopped
httpd is stopped
irattach is stopped
irqbalance is stopped
No status available for this package
lisa is stopped
etc/init.d/microcode_ctl: reading microcode status is not yet supported
Configured devices:
lo ppp0 ppp1
Currently active devices:
lo ppp0
rpc.mountd is stopped
nfsd is stopped
rpc.rquotad is stopped
rpc.statd is stopped
nscd is stopped
ntpd is stopped
cardmgr (pid 1342) is running...
portmap (pid 1292) is running...
The random data source exists
saslauthd is stopped
sendmail dead but subsys locked
smartd is stopped
snmpd is stopped
snmptrapd is stopped
sshd dead but subsys locked
syslogd (pid 1270) is running...
klogd (pid 1274) is running...
vsftpd is stopped
winbindd is stopped
xfs (pid 1539) is running...
xinetd (pid 1483) is running...
ypbind is stopped

notice all the dead but subsys locked.
well it turns out that the scripts in /etc/init.d are running the start routines just fine and touching those files for lock. but there is not accompanying file for pid in /var/run
this is aproblem as that means they are not running. And hence when the /etc/init.d/functions killproc() procedure is ran it can not find a pid to kill and therefor issues an error message back to init.d script which called and then you get the shutdown failed for each respective service. Now the question that I have is what do all these processes have in common that would not allow them to start?

To let you know /var/log/messages says shutdown failed on these processes and each processes logs has no idea it is not running. This is very perplexing. How can a program say it is running back to the init.d script when it most certainly is not?
I looked at all previous problems in LQ and redhat, and googled it, yet to no avail. It seems that this problem comes close to being solved but then it is lost. One thread actually made it 24 posts in to only die because of Christmas break. <= how disappointing. If anyone has a shot in the dark or the answer I would greatly like to solve this little problem.
Old 04-24-2005, 11:36 PM   #2
LQ Newbie
Registered: Apr 2005
Location: FL
Distribution: Fedora Core 10
Posts: 25

Rep: Reputation: 15
Hey dude,

This post is over six months old, but I found a fix... I have just come accross this problem myself... So this is also for any other newbies out there that are having this problem:

If you get [service name] dead but subsyslocked when you check the status (in my case it was vsftpd), simply open your favorite text editor and punch in four numbers (i.e. 1234) and save the file as [service name].pid

Go to your terminal and type
>service [service name] restart

Or if your are using the GNOME GUI, open the Services GUI and click RESTART. You will see a brand new pid for whatever service you are dealing with.

Just be sure to NOT RESAVE when you close the text editor, as this will overwrite the pid that the OS created...

Hope this helps!!!

Last edited by ApachePadowan; 04-24-2005 at 11:57 PM.
Old 07-18-2006, 12:16 AM   #3
LQ Newbie
Registered: Jul 2006
Posts: 2

Rep: Reputation: 0
good morning
Old 12-19-2006, 11:23 AM   #4
Registered: May 2001
Location: Canada
Distribution: old ones
Posts: 555

Rep: Reputation: 33
Same problem here with the "<process> dead but subsys locked" where deleting the process file in /var/lock/subsys does not help.

I followed the procedure above and the error has changed to "<process> dead but pid file exists"

The process still won't run.
Old 12-31-2006, 11:49 PM   #5
LQ Newbie
Registered: Apr 2005
Location: FL
Distribution: Fedora Core 10
Posts: 25

Rep: Reputation: 15
Wow... been over a year since I posted this and people are still having the problem...


I hope you're issue has been resolved by now... if not, keep reading:

Did you save the file upon exit? If you did, then don't. It's been a while since I did this, and ever since I haven't had the problem... Actually, I haven't had the problem since I went from Redhat 9.0 to Fedora Core 4.

Also, what Linux are you running and what program in particular is giving you the headache?
Old 01-01-2007, 12:02 AM   #6
LQ Newbie
Registered: Apr 2005
Location: FL
Distribution: Fedora Core 10
Posts: 25

Rep: Reputation: 15
Here is the other problem I think, Avatar: You deleted the file in /var/lock/subsys... I don't remember actually deleting anything, I just overwrote the pid file in /var/run...

Since you deleted the lock file (the file in /var/lock/subsys), but not the actual pid file, the OS now thinks the process is dead, but since there is still a PID file available, it gives you the error message you mentioned.

Don't delete the file(s) in /var/lock/subsys, since this keeps a list of the processes that are running. It's the PID files in /var/run that are confusing your OS. If you deleted the files in /var/lock/subsys, make sure to also delete the corresponding PID file in /var/run. Then try running
>service <process> start

Let me know if it helps...


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
/var/run/[XXX].pid - Tcl pid code liguorir Linux - Software 1 05-20-2004 10:32 PM
rm cannot remove /var/run/ and /var/run/ danishmr Linux - Software 1 05-04-2004 08:01 AM
ERROR: Couldn't write pid to pid file lawrencegoodman Linux - Newbie 2 02-13-2004 08:05 PM
can't lock /var/run/ robeb Linux - General 0 06-08-2002 12:26 PM
cannot write PID to var/run/news cruella Linux - Newbie 1 01-22-2002 06:51 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:29 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration