[Nut-upsuser] upsd not starting sometimes (Porteus 3.1, nut 2.7.2)

Rob Groner rgroner at RTD.com
Wed Jul 8 17:50:35 UTC 2015

That seems to have fixed it...I've run it twice now through our tests and no recurrence of the problem.

So I'll use the --with-altpidpath configure option to move it to /var/run instead of /var/state.


Rob Groner
Software Engineer

RTD Embedded Technologies, Inc.
ISO 9001 and AS9100 Certified
Ph: 814-234-8087

-----Original Message-----
From: Charles Lepple [mailto:clepple at gmail.com] 
Sent: Tuesday, July 07, 2015 8:25 PM
To: Rob Groner
Cc: nut-upsuser Mailing List
Subject: Re: [Nut-upsuser] upsd not starting sometimes (Porteus 3.1, nut 2.7.2)

On Jul 7, 2015, at 4:12 PM, Rob Groner <rgroner at RTD.com> wrote:

> It does that MOST of the time.  However, a significant part of the time, the system comes up, and then doesn't respond to loss of power.  Doing some checking, I find that the reason is because upsd never started.  Capturing its output, I see that it says :
> Fatal error: A previous upsd instance is already running!
> Either stop the previous instance first, or use the 'reload' command.

What might be happening is that the PID file is left over from the last test, and another process got that PID instead.

Due to history and conflicting requirements, the path selection is not as simple as it could be. From ./configure --help:

  --with-statepath=PATH   path for ups state files (/var/state/ups)
  --with-altpidpath=PATH  path for driver/upsd .pid files (<statepath>) [...]
  --with-pidpath=PATH     path for .pid files (/var/run)

You might not want to use the default for --with-altpidpath: /var/state/* is not generally cleared at boot time, whereas /var/run is either wiped or mounted on a RAM filesystem.

However, you might want the statepath protected - Debian uses the following:

$ ls -ld /var/run/nut
drwxrwx--- 2 root nut 60 Jun 24 17:13 /var/run/nut

Charles Lepple
clepple at gmail

More information about the Nut-upsuser mailing list