LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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.

Notices

Reply
 
Search this Thread
Old 06-22-2004, 01:40 PM   #1
sirpimpsalot
Member
 
Registered: Feb 2004
Posts: 141

Rep: Reputation: 15
APCUPSD - Unable to create UPS lock file


I just upgraded my suse 9.0 box to 9.1. Apparently this upgrade takes the kernel from 2.4 to 2.6... which has caused some problems.

this is one of them... anytime I try to start or stop apcupsd from the command line:

apcupsd FATAL ERROR in apcdevice.c at line 105
APCUPSD - Unable to create UPS lock file

Now I have the LOCKFILE variable in the config file pointing to a valid directory with read write execute permission for everyone. I even tried just commenting the lockfile entry out. same error?

the program is sucessfully creating the following file "LCKhiddev[0-15]" in the proper directory with -rw-r--r-- (644) permissions owned by root.

Anyone got any ideas?

Thanks

Last edited by sirpimpsalot; 06-22-2004 at 01:43 PM.
 
Old 07-15-2004, 03:47 AM   #2
imark
LQ Newbie
 
Registered: Jul 2004
Posts: 2

Rep: Reputation: 0
Angry I have the same problem

I have the same problem with SuSe 9.0 and would be happy if somebody has an idea ....
 
Old 08-04-2004, 08:16 AM   #3
jester_urans
LQ Newbie
 
Registered: Aug 2004
Posts: 2

Rep: Reputation: 1
Hello imark!
Think you found the answer already, but for the others:
This error usually occurs if you start the apcupsd twice. If "/etc/init.d/apcupsd stop" doesn't delete the Lockfile, then "joe /var/lock/LCK*" (or what ever the name of the Lockfile is)schows you the PID of the previous apcupsd-process. With "ps -p PID" you look up if it's really a apcupsd running. Then "kill PID"(the one you found out above) schould do the trick. Then "/etc/init.d/apcupsd start" schould be able to create the Lockfile.
Have fun!
 
1 members found this post helpful.
Old 08-23-2004, 01:50 PM   #4
jonr
Senior Member
 
Registered: Jan 2003
Location: Kansas City, Missouri, USA
Distribution: Ubuntu
Posts: 1,040

Rep: Reputation: 47
I'm having the same problem, and there's no instance of apcupsd running. It never gets off the ground--during boot when the process would start, I get the same message "unable to create USP lock file."
 
Old 08-23-2004, 02:15 PM   #5
jonr
Senior Member
 
Registered: Jan 2003
Location: Kansas City, Missouri, USA
Distribution: Ubuntu
Posts: 1,040

Rep: Reputation: 47
OK, I figured out how to make apcupsd work again. I found various references via Google and it seems there's a bug in the apcupsd software that makes it not release a lock file after a power failure. I had tested it by pulling the power plug (=power failure) and the system shut down properly via apcupsd, very nice. But upon rebooting apcupsd would not start again because of this error--the lockfile still existing.

I deleted the file named /var/lock/apcupsd and then I was able to restart apcupsd.

Now if I only knew how to make that happen automatically next time the power goes out or I test the thing!

But at least that is one way to get it running again.
 
Old 08-23-2004, 03:21 PM   #6
jonr
Senior Member
 
Registered: Jan 2003
Location: Kansas City, Missouri, USA
Distribution: Ubuntu
Posts: 1,040

Rep: Reputation: 47
All right, here's how I got this situation fixed on my Mandrake 9.2 system.

I edited /etc/rc.d/init.d/apcupsd by inserting the line:

rm -f /var/lock/apcupsd

right after

case "$1" in
start)

where there are two pre-existing lines with rm commands.

That worked. I tested it by pulling the plug from the wall. After the five-minute interval I'd set in the configuration file, the system shut down correctly; I then powered off the USP as the program instructs you to, and restored the mains power, powered on the USP, the computer rebooted and USP monitoring is in place again.

I hope this helps somebody.
 
1 members found this post helpful.
Old 11-18-2012, 12:24 PM   #7
javipod
LQ Newbie
 
Registered: Nov 2012
Posts: 1

Rep: Reputation: Disabled
Smile

Hello

Be sure your apcupsd service is not running and try again to execute apctest. It works for me

Regards
 
  


Reply


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
groupadd: unable to lock group file?! macagent Linux - Newbie 6 07-08-2007 06:31 PM
apcupsd cannot find usb ups on Debian Sarge davelk Linux - Hardware 2 10-14-2006 12:28 PM
userdel: unable to lock password file asc3ndant Linux - General 1 06-20-2003 02:07 PM
unable to lock password file beefyd Linux - Security 3 09-08-2002 10:33 AM
can't create lock file? Class Zero Linux - Newbie 3 01-30-2002 06:24 AM


All times are GMT -5. The time now is 04:03 PM.

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