Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[Resolved] Problems with apcupsd starting at regular times when disabled.

Featured Replies

I was using the built in UPS settings in Unraid, but this was not sufficient for my needs as it didn't support other item on my network, so I installed NUT server on a Raspberry Pi, connected the UPS USB cable to it, added the NUT docker to Unraid and connected it all up to the Pi NUT server while switching the UPS Settings> Start APC UPS daemon to No. 
Everything seems to be working with the NUT server, all my devices see it and are set up accordingly, including Unraid. Unfortunately, every week on a Sunday at approx 04:40 I get a notification

apcupsd 3.14.14 (31 May 2016) slackware startup succeeded

Communications with UPS lost

these errors continue to be logged until I manually switch off the daemon Settings>UPS Settings.

When I go to the Settings>UPS Settings tab, the status is showing as running, despite the Start APC UPS daemon showing as no. The way to switch this off is to click the default button which resets it. 

FWIW, I have ran cat /etc/cron.d/root and nothing is listed as running around 4am on a weekly basis. 

Has anyone else experienced this or can anyone give me an idea on how to apply a correct fix other than setting a cron job a few minutes after the daemon starts to switch it off?

 

Edited by Boyturtle

  • 2 weeks later...
  • Author
On 2/11/2022 at 12:58 PM, JonathanM said:

apcupsd has clients for windows, osx and linux. What other items do you need?

https://sourceforge.net/projects/apcupsd/files/

Thanks for your reply and apologies for not replying sooner nor making my earlier post clearer. My preference is to run the UPS management on a device that sips power (hence the Pi) and my unraid server is much more power hungry. Doing it this way allows me to shut unraid down before other devices on my network.

 

What I'd like to achieve here is to disable the apcupsd 3.14.14 (31 May 2016) slackware startup, but have no idea how to to stop this. Effectively, I'd like the deamon to revert to how it was before I made the initial changes when adding the UPS. As I stated in my earlier post, there is nothing in cron to indicate that there is anything in place to start at 4:40 every Sunday morning.

 

Do I need to make changes in unraids /etc/apcupsd/apcupsd.conf file, /etc/rc.d/rc.apcupsd or an altogether different file?

  • Community Expert
20 minutes ago, Boyturtle said:

apcupsd 3.14.14 (31 May 2016) slackware startup

I am seeing this on my machine, I am using NUT but apcupsd seems to start 4.40 each sunday.

19 minutes ago, Boyturtle said:

4:40 every Sunday morning

That seems to imply it's the weekly schedule.  You sure there's nothing running via user scripts (if installed)

 

Install Dynamix Schedules and then look at Settings - Schedules - Fixed Schedules or

 

ls /etc/cron.weekly

 

  • Community Expert
27 minutes ago, Squid said:

That seems to imply it's the weekly schedule.  You sure there's nothing running via user scripts (if installed)

 

Install Dynamix Schedules and then look at Settings - Schedules - Fixed Schedules or

 

ls /etc/cron.weekly

 

Hi @Squid its not weekly as that is running at 4.30 its daily. Its the log rotate fuction is restarting it.

 

root@unraid:/usr/sbin# cat /etc/logrotate.d/apcupsd 
/var/log/apcupsd.events {
  rotate 4
  weekly
  notifempty
  missingok
  postrotate
    /etc/rc.d/rc.apcupsd restart 1>/dev/null || true
  endscript
}

 

Any ideas on how the file is created or is it because I have an enabled its created logs even now I have disabled?

 

do I just need to delete the apcupsd.events files?

Edited by SimonF

56 minutes ago, Boyturtle said:

My preference is to run the UPS management on a device that sips power (hence the Pi)

You can run apcupsd on your pi as the host, and connect Unraid as a network client that shuts down when the pi reports an outage.

53 minutes ago, SimonF said:

log rotate fuction

You're correct.  Thanks.

  • Author
48 minutes ago, Squid said:

You sure there's nothing running via user scripts (if installed)

My only weekly scripts are the cleaning up of plex cached files and ClamAV scan, nothing apcupsd related.

Installed Dynamix Schedules, user.script.start.weekly.sh runs at 4.30 on Sunday and exportrotate, logrotate, user.script.start.daily.sh run daily at 4.40.

My output from cat /etc/logrotate.d/apcupsd is the same as @SimonF

/var/log/apcupsd.events {
  rotate 4
  weekly
  notifempty
  missingok
  postrotate
    /etc/rc.d/rc.apcupsd restart 1>/dev/null || true
  endscript
}

 

As I'm not using unraid's apcupsd, am I safe to edit /etc/logrotate.d/apcupsd and comment out the line    /etc/rc.d/rc.apcupsd restart 1>/dev/null || true? Should this stop the daemon restarting?

  • Author
1 hour ago, SimonF said:

do I just need to delete the apcupsd.events files?

Would this stop the daemon from starting at 4.40 every Sunday?

  • Community Expert
40 minutes ago, Boyturtle said:

Would this stop the daemon from starting at 4.40 every Sunday?

Not sure I have deleted an will check next Sunday. Tried changing the schedule to run again today didn't seem to do anything so not sure how it tracks weekly.

  • 2 weeks later...
  • Author

No errors in the syslogs from 4.40 am and beyond yesterday, after I made the changes described above 😃

  • Boyturtle changed the title to [Resolved] Problems with apcupsd starting at regular times when disabled.
  • 1 year later...

To make changes persistent:
 

Disable apcupsd by resetting settings to Default in UPS settings

 

Open the terminal and copy your current logrotate script for apcupsd to your boot flash drive:

mkdir -p /boot/config/custom/ && cp /etc/logrotate.d/apcupsd /boot/config/custom/apcupsd

 

Open the script you copied on your flash drive using an editor (e.g. nano /boot/config/custom/apcupsd) and remove the following lines:

postrotate
    /etc/rc.d/rc.apcupsd restart 1>/dev/null || true
endscript

 

Mine looks like this after making the changes:

/var/log/apcupsd.events {
  rotate 4
  weekly
  notifempty
  missingok
}

 

Now make sure your /boot/config/go script will overwrite the logrotate.d config with the updated file on boot:

echo "cp /boot/config/custom/apcupsd /etc/logrotate.d/apcupsd" >> /boot/config/go

 

To test that it works and apply the changes now, copy the file and run the logrotate job:

cp /boot/config/custom/apcupsd /etc/logrotate.d/apcupsd && /etc/cron.daily/logrotate

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.