Project

General

Profile

Bug #25659

Reset UPS shutdown timer when shutdown mode changes

Added by Ryan Baumgart almost 2 years ago. Updated about 1 year ago.

Status:
Done
Priority:
No priority
Assignee:
Waqar Ahmed
Category:
Middleware
Target version:
Seen in:
Severity:
New
Reason for Closing:
Reason for Blocked:
Needs QA:
No
Needs Doc:
No
Needs Merging:
No
Needs Automation:
No
Support Suite Ticket:
n/a
Hardware Configuration:

Any configuration in FreeNAS 11 using stable GUI
FreeBSD 11.0-STABLE (FreeNAS.amd64) #0 r313908+d7d07647f69(freenas/11.0-stable):

ChangeLog Required:
No

Description

Switching from Shutdown mode: UPS reaches low battery to -> UPS goes on battery; you're then allowed to enter a shutdown timer in seconds, which specifies the FINALDELAY tag in upsmon.conf

However after saving, if shutdown mode is then switched back to UPS reaches low battery, FINALDELAY is kept at the original value, negating the change the user just made, leading to unintended results.

Expected behavior is FINALDELAY to either be cleared completely or to be reset to the default value specified by NUT's configuration of 5 seconds.

History

#1 Updated by Dru Lavigne almost 2 years ago

  • Assignee changed from Release Council to William Grzybowski

William: does this sound like a middleware issue? Also, feel free to load balance with Vladimir or Nikola.

#2 Updated by William Grzybowski almost 2 years ago

  • Assignee changed from William Grzybowski to Nikola Gigic

Nikola, I believe this is something you can handle.

Thanks!

#3 Updated by Nikola Gigic almost 2 years ago

  • Status changed from Unscreened to Screened
  • Target version set to 11.1

#4 Avatar?id=14398&size=24x24 Updated by Kris Moore over 1 year ago

  • Target version changed from 11.1 to 11.1-U1

#5 Updated by Nikola Gigic over 1 year ago

  • Status changed from Screened to Needs Developer Review
  • Assignee changed from Nikola Gigic to William Grzybowski

#6 Updated by William Grzybowski over 1 year ago

  • Status changed from Needs Developer Review to Screened

#7 Updated by Roger Hayter over 1 year ago

When last reported (a few years ago) this bug was marked 'not to be fixed' I think. The workaround is to change and save the time delay (as 15sec or whatever is sensible) before changing mode. (The shutdown timer mode shouldn't be altering FINALDELAY anyway, as it is unnecessary and makes that mode work incorrectly.)

#8 Updated by Charles Goetzman over 1 year ago

I was having trouble configuring a slave device because of this, and really any increase in FINALDELAY is unsafe for a slave. If a slave's finaldelay is longer than the master's HOSTSYNC, you will not run your SHUTDOWNCMD before you lose power.

Even for a master it shouldn't be using finaldelay to hold off shutdown, that's what the upssched timers are for. Finaldelay only determines the time between notifycmd and shutdowncmd once upsmon has already decided to shutdown. Since notifycmd is only used to send an email in FreeNAS's upssched config, there's no reason to have any significant delay between the two. Also if power is restored during a long finaldelay, you will shutdown anyway for no reason. It should probably just be fixed at 5 seconds like the examples configs show.

#9 Avatar?id=14398&size=24x24 Updated by Kris Moore over 1 year ago

  • Target version changed from 11.1-U1 to 11.2-BETA1

#10 Updated by Dru Lavigne over 1 year ago

  • Status changed from Screened to Not Started

#11 Avatar?id=13649&size=24x24 Updated by Ben Gadd over 1 year ago

  • Due date set to 03/09/2018

#12 Updated by William Grzybowski over 1 year ago

  • Category changed from OS to Middleware
  • Assignee changed from William Grzybowski to Waqar Ahmed

Waqar, I believe this is a low hanging fruit but a great entry point for you. Let me know if you have any questions.

#13 Updated by Waqar Ahmed over 1 year ago

  • Status changed from Not Started to In Progress

#14 Updated by Waqar Ahmed over 1 year ago

  • % Done changed from 0 to 100

#15 Updated by Waqar Ahmed over 1 year ago

  • Status changed from In Progress to Done

#16 Updated by Dru Lavigne over 1 year ago

  • Subject changed from UPS - Changing Shutdown mode does not clear Shutdown timer in GUI to Reset UPS shutdown timer when shutdown mode changes
  • Needs Doc changed from Yes to No
  • Needs Merging changed from Yes to No

#17 Updated by Roger Hayter over 1 year ago

If your code does what the title says it is probably the wrong thing.

1. FINALDELAY in upsmon.conf should stay at 5 and the timer setting code should not alter it. (It should only alter the timer in upssched.conf and this does not need resetting with mode change.)

2. Just for the sake of those current FreeNAS installs that have previously altered FINALDELAY it should be initialised to 5 at boot or UPS service start and then left untouched.

#18 Updated by Roger Hayter over 1 year ago

PS having looked at the commit just putting the following without using the if clause or the variable ${ups_shutdowntimer} should do it.

FINALDELAY 5

#19 Updated by Dru Lavigne about 1 year ago

  • Status changed from Done to Ready for Testing

#20 Updated by Dru Lavigne about 1 year ago

  • Status changed from Ready for Testing to Done
  • Severity set to New

#22 Updated by Dru Lavigne about 1 year ago

  • Needs QA changed from Yes to No

Also available in: Atom PDF