Boyturtle Posted February 11, 2022 Share Posted February 11, 2022 (edited) 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 February 28, 2022 by Boyturtle Quote Link to comment
JonathanM Posted February 11, 2022 Share Posted February 11, 2022 10 hours ago, Boyturtle said: this was not sufficient for my needs as it didn't support other item on my network, apcupsd has clients for windows, osx and linux. What other items do you need? https://sourceforge.net/projects/apcupsd/files/ Quote Link to comment
Boyturtle Posted February 20, 2022 Author Share Posted February 20, 2022 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? Quote Link to comment
SimonF Posted February 20, 2022 Share Posted February 20, 2022 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. Quote Link to comment
Squid Posted February 20, 2022 Share Posted February 20, 2022 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 Quote Link to comment
SimonF Posted February 20, 2022 Share Posted February 20, 2022 (edited) 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 February 20, 2022 by SimonF Quote Link to comment
JonathanM Posted February 20, 2022 Share Posted February 20, 2022 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. Quote Link to comment
Squid Posted February 20, 2022 Share Posted February 20, 2022 53 minutes ago, SimonF said: log rotate fuction You're correct. Thanks. Quote Link to comment
Boyturtle Posted February 20, 2022 Author Share Posted February 20, 2022 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? Quote Link to comment
Boyturtle Posted February 20, 2022 Author Share Posted February 20, 2022 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? Quote Link to comment
SimonF Posted February 20, 2022 Share Posted February 20, 2022 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. Quote Link to comment
SimonF Posted February 20, 2022 Share Posted February 20, 2022 Logged a bug report for it also. Quote Link to comment
Boyturtle Posted February 28, 2022 Author Share Posted February 28, 2022 No errors in the syslogs from 4.40 am and beyond yesterday, after I made the changes described above 😃 1 Quote Link to comment
Manchineel Posted May 28 Share Posted May 28 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 Quote Link to comment
Recommended Posts
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.