Uploaded image for project: 'FreeNAS / TrueNAS'
  1. FreeNAS / TrueNAS
  2. NAS-101873

Fix bug in custom-upssched-cmd

    XMLWordPrintable

    Details

    • Attempts to pass:
      0
    • Testing System:
      VMware Virtual Machine
    • QA Status:
      Not Tested
    • QE Blocker:
      ups
    • Acceptance Criteria:
      Hide
      It should be ensured that when ups battery is low and ups is scheduled for a shutdown in this case, it shuts down as expected. Also another case to ensure is that there are cases when ups is online and on low battery ( varies with model/driver/hardware ), in that case the ups should not shutdown and an error message should be logged instead.
      Show
      It should be ensured that when ups battery is low and ups is scheduled for a shutdown in this case, it shuts down as expected. Also another case to ensure is that there are cases when ups is online and on low battery ( varies with model/driver/hardware ), in that case the ups should not shutdown and an error message should be logged instead.

      Description

      Hi,

      the script /usr/local/bin/custom-upssched-cmd has an error on line 32:

      32                 if [ -n $(upsc $ident | grep "ups.status.*OL") ]; then
      33                         logger -t upssched-cmd "Shutdown not initiated as ups.status indicates ${ident} is ONLINE (OL)"
      34                 else
      35                         logger -t upssched-cmd "issuing shutdown"
      36                         /usr/local/sbin/upsmon -c fsd
      37                 fi
      

      This  supposed to test if the UPS is ONLINE and then issue a shutdown if not but the "-n" in line 32 inverts the logic. Removing the "-n" fixes this.

        Attachments

          Container Issues

            Issue Links

              Activity

                People

                • Assignee:
                  waqar Waqar Ahmed
                  Reporter:
                  markusro Markus Rosenstihl
                  QE Engineer:
                  Bonnie Follweiler
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  4 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Merged after freeze:

                    Summary Panel