LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 02-24-2009, 04:29 AM   #1
engelienart
Member
 
Registered: Feb 2009
Location: Netherlands
Distribution: Kubuntu, Debian
Posts: 73

Rep: Reputation: 16
apcupsd: what is the function of a LOCKFILE?


I want to install an APC UPS Back-ups RS 800. For this I am using the apcupsd. In apcupsd.conf you can create a LOCKFILE. But I fail to understand its function. Why do I want, or do I not want a LOCKFILE?

Thanx for your advice
 
Old 02-24-2009, 05:59 AM   #2
zedmelon
Member
 
Registered: Jun 2004
Location: colorado, USA
Distribution: slack, oBSD
Posts: 119

Rep: Reputation: 24
A lock file generally indicates a file is in use. For example, the Vim editor will lock a file while you edit it, so you don't try to modify it from another terminal.

It can also mean a program (or daemon) is running and shouldn't be duplicated without first stopping the original, which will remove the lock file as it exits.

As you're being given the option to use one or not, this daemon may be different. There may be more info in the docs.

Last edited by zedmelon; 02-24-2009 at 06:01 AM.
 
Old 02-24-2009, 06:32 AM   #3
engelienart
Member
 
Registered: Feb 2009
Location: Netherlands
Distribution: Kubuntu, Debian
Posts: 73

Original Poster
Rep: Reputation: 16
Thanx ZedMelon, I know what a lock file is
I wanted to know what the function LOCKFILE in apcupsd is. The man page says:

LOCKFILE -- <path to lockfile>
By supplying this argument, "apcupsd" tries to create a lockfile for the serial or USB port in the specified directory.

So I know it makes a lockfile for the serial or USB port, but why whould I do that? Should I? Or should I not and why?
 
Old 02-26-2009, 12:25 AM   #4
zedmelon
Member
 
Registered: Jun 2004
Location: colorado, USA
Distribution: slack, oBSD
Posts: 119

Rep: Reputation: 24
Quote:
Originally Posted by engelienart View Post
I know what a lock file is
Ewps, sorry.

Well, I'm *guessing* (read: disclaimer) that since the lockfile would prevent anything else from using the port, you'd "opt out" if you want to share it with another program.

Taking my above guess as granted, an example:

I have some X-10 lighting controllers which enable my Linux box to control the lights on the front of my house. I wrote a shell script to follow a schedule and never have to remember it's getting dark or to turn them off at bedtime. They're controlled through a small RF transmitter with a male serial port on one end and female on the other. The transmitter has a pass-through characteristic I could use to share the serial port with something else, if I had anything else needing a serial connection.

To make a short story long...

Unless you catch yourself thinking, "Man, if only I had another serial port," the lock file is probably the preferred route. Also, I have no idea how you'd split signals or coordinate the time-share on the port.
 
Old 02-27-2009, 04:02 AM   #5
engelienart
Member
 
Registered: Feb 2009
Location: Netherlands
Distribution: Kubuntu, Debian
Posts: 73

Original Poster
Rep: Reputation: 16
lmao. Ok, my xmas lights next xmas will rock!

So LOCKFILE is a good option if I don't want other progmras to use that specific port. I my case it is an obsolete function: no other program will use that port. (if it does, I 'll add the LOCKFILE option)

And thanx for your explination.
 
Old 02-28-2009, 03:18 AM   #6
zedmelon
Member
 
Registered: Jun 2004
Location: colorado, USA
Distribution: slack, oBSD
Posts: 119

Rep: Reputation: 24
Quote:
Originally Posted by engelienart View Post
lmao. Ok, my xmas lights next xmas will rock!
Sure, you could use them for Christmas lights too. I bought the module that replaces a standard light switch, so they're on my regular lights. It's quite convenient, and my wife and son don't have to worry about driving home to a dark house if I'm working late.


There's a remote I never got working quite right. The X-10 hardware is neat, but not of the greatest quality. Still a fun project though. Way geeky.

BTW, I'd actually use the lockfile anyway, then you'll be certain nothing else will send a signal to the UPS's port.

--my two cents

Last edited by zedmelon; 02-28-2009 at 03:20 AM.
 
Old 03-01-2009, 04:55 AM   #7
engelienart
Member
 
Registered: Feb 2009
Location: Netherlands
Distribution: Kubuntu, Debian
Posts: 73

Original Poster
Rep: Reputation: 16
Buy an expensive X-10 hardware? (I don't even know what it is) I 'll think of something cheaper: like telling my gf to switch the xmaslights on and off.

Thanx for your 2 cents. I 've been reading some manuals. I 'll use the standard settings and keep my fingers crossed.
 
  


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
apcupsd help ahh_username_taken Slackware 2 08-29-2008 02:38 PM
Help with apcupsd Rustylinux Red Hat 1 07-31-2008 11:13 PM
mozilla lockfile deletion fibbi Linux - Software 1 04-15-2004 12:13 PM
Can't add users... vipw lockfile? jordan0 Linux - Newbie 1 09-29-2003 04:48 PM
vm-pop3d Failed to create lockfile mocny Linux - General 0 08-18-2002 04:42 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:34 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
Open Source Consulting | Domain Registration