UPS plugin not working

    • OMV 4.x
    • Resolved

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • UPS plugin not working

      My BIOS has only two options for the serial port: enable/disable and IRQ address.

      From command line:
      # dmesg | grep tty
      [ 0.000000] console [tty0] enabled
      [ 1.011463] 00:05: ttyS2 at I/O 0x3e8 (irq = 3, base_baud = 115200) is a 16550A

      The following configuration is saved for the UPS (same as I used on 2.x and earlier):

      Source Code

      1. Identifier:
      2. SU1400
      3. Driver configuration directives:
      4. driver = apcsmart
      5. port = /dev/ttyS2
      6. cable = 940-0024C
      7. sdtype = 2
      8. sdorder = -1
      9. Shutdown mode:
      10. UPS goes on battery
      11. Shutdown timer:
      12. 300
      Display All

      When I attempt to enable the UPS plugin and Apply the configuration, I get the following error dialog:

      Failed to execute command 'export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin; export LANG=C; systemctl start 'nut-driver' 2>&1' with exit code '1': Job for nut-driver.service failed because the control process exited with error code.See "systemctl status nut-driver.service" and "journalctl -xe" for details.

      When I select 'View details' from GUI:

      Source Code

      1. Error #0:
      2. OMV\ExecException: Failed to execute command 'export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin; export LANG=C; systemctl start 'nut-driver' 2>&1' with exit code '1': Job for nut-driver.service failed because the control process exited with error code.
      3. See "systemctl status nut-driver.service" and "journalctl -xe" for details. in /usr/share/php/openmediavault/system/process.inc:175
      4. Stack trace:
      5. #0 /usr/share/php/openmediavault/system/systemctl.inc(86): OMV\System\Process->execute(Array, 1)
      6. #1 /usr/share/php/openmediavault/system/systemctl.inc(104): OMV\System\SystemCtl->exec('start', NULL, false)
      7. #2 /usr/share/openmediavault/engined/module/nut.inc(92): OMV\System\SystemCtl->enable(true)
      8. #3 /usr/share/openmediavault/engined/rpc/config.inc(194): OMVModuleNetworkUPSTools->startService()
      9. #4 [internal function]: OMVRpcServiceConfig->applyChanges(Array, Array)
      10. #5 /usr/share/php/openmediavault/rpc/serviceabstract.inc(123): call_user_func_array(Array, Array)
      11. #6 /usr/share/php/openmediavault/rpc/serviceabstract.inc(149): OMV\Rpc\ServiceAbstract->callMethod('applyChanges', Array, Array)
      12. #7 /usr/share/php/openmediavault/rpc/serviceabstract.inc(536): OMV\Rpc\ServiceAbstract->OMV\Rpc\{closure}('/tmp/bgstatusMn...', '/tmp/bgoutputsm...')
      13. #8 /usr/share/php/openmediavault/rpc/serviceabstract.inc(159): OMV\Rpc\ServiceAbstract->execBgProc(Object(Closure))
      14. #9 /usr/share/openmediavault/engined/rpc/config.inc(213): OMV\Rpc\ServiceAbstract->callMethodBg('applyChanges', Array, Array)
      15. #10 [internal function]: OMVRpcServiceConfig->applyChangesBg(Array, Array)
      16. #11 /usr/share/php/openmediavault/rpc/serviceabstract.inc(123): call_user_func_array(Array, Array)
      17. #12 /usr/share/php/openmediavault/rpc/rpc.inc(86): OMV\Rpc\ServiceAbstract->callMethod('applyChangesBg', Array, Array)
      18. #13 /usr/sbin/omv-engined(536): OMV\Rpc\Rpc::call('Config', 'applyChangesBg', Array, Array, 1)
      19. #14 {main}
      Display All

      systemctl status nut-driver.service:

      Source Code

      1. # systemctl status nut-driver.service
      2. ● nut-driver.service - Network UPS Tools - power device driver controller
      3. Loaded: loaded (/lib/systemd/system/nut-driver.service; static; vendor preset: enabled)
      4. Active: failed (Result: exit-code) since Sun 2018-04-08 09:59:45 PDT; 16min ago
      5. Process: 4218 ExecStart=/sbin/upsdrvctl start (code=exited, status=1/FAILURE)
      6. Apr 08 09:59:45 HomeServer upsdrvctl[4218]: - Use another port (with the right permissions)
      7. Apr 08 09:59:45 HomeServer upsdrvctl[4218]: - Fix the port owner/group or permissions on this port
      8. Apr 08 09:59:45 HomeServer upsdrvctl[4218]: - Run this driver as another user (upsdrvctl -u or 'user=...' in ups.conf).
      9. Apr 08 09:59:45 HomeServer upsdrvctl[4218]: See upsdrvctl(8) and ups.conf(5).
      10. Apr 08 09:59:45 HomeServer upsdrvctl[4218]: Driver failed to start (exit status=1)
      11. Apr 08 09:59:45 HomeServer upsdrvctl[4218]: Network UPS Tools - UPS driver controller 2.7.4
      12. Apr 08 09:59:45 HomeServer systemd[1]: nut-driver.service: Control process exited, code=exited status=1
      13. Apr 08 09:59:45 HomeServer systemd[1]: Failed to start Network UPS Tools - power device driver controller.
      14. Apr 08 09:59:45 HomeServer systemd[1]: nut-driver.service: Unit entered failed state.
      15. Apr 08 09:59:45 HomeServer systemd[1]: nut-driver.service: Failed with result 'exit-code'.
      Display All

      journalctl -xe produces a huge output. I *think* this is the relevant bits:

      Source Code

      1. Apr 08 10:22:22 HomeServer systemd[1]: Starting Network UPS Tools - power device driver controller...
      2. -- Subject: Unit nut-driver.service has begun start-up
      3. -- Defined-By: systemd
      4. -- Support: https://www.debian.org/support
      5. --
      6. -- Unit nut-driver.service has begun starting up.
      7. Apr 08 10:22:22 HomeServer upsdrvctl[6594]: Fatal error: unusable configuration
      8. Apr 08 10:22:22 HomeServer upsdrvctl[6594]: Network UPS Tools - APC Smart protocol driver 3.1 (2.7.4)
      9. Apr 08 10:22:22 HomeServer upsdrvctl[6594]: APC command table version 3.1
      10. Apr 08 10:22:22 HomeServer upsdrvctl[6594]: Unable to open /dev/ttyS2: Permission denied
      11. Apr 08 10:22:22 HomeServer upsdrvctl[6594]: Current user id: nut (113)
      12. Apr 08 10:22:22 HomeServer upsdrvctl[6594]: Serial port owner: root (0)
      13. Apr 08 10:22:22 HomeServer upsdrvctl[6594]: Serial port group: dialout (20)
      14. Apr 08 10:22:22 HomeServer upsdrvctl[6594]: Mode of port: 0660
      15. Apr 08 10:22:22 HomeServer upsdrvctl[6594]: Things to try:
      16. Apr 08 10:22:22 HomeServer upsdrvctl[6594]: - Use another port (with the right permissions)
      17. Apr 08 10:22:22 HomeServer upsdrvctl[6594]: - Fix the port owner/group or permissions on this port
      18. Apr 08 10:22:22 HomeServer upsdrvctl[6594]: - Run this driver as another user (upsdrvctl -u or 'user=...' in ups.conf).
      19. Apr 08 10:22:22 HomeServer upsdrvctl[6594]: See upsdrvctl(8) and ups.conf(5).
      20. Apr 08 10:22:22 HomeServer upsdrvctl[6594]: Driver failed to start (exit status=1)
      21. Apr 08 10:22:22 HomeServer upsdrvctl[6594]: Network UPS Tools - UPS driver controller 2.7.4
      22. Apr 08 10:22:22 HomeServer systemd[1]: nut-driver.service: Control process exited, code=exited status=1
      23. Apr 08 10:22:22 HomeServer systemd[1]: Failed to start Network UPS Tools - power device driver controller.
      Display All

      What am I missing in my configuration?
      OMV 4.1.4-1 (Arrakis); Shuttle XPC SH67H3; Intel Core i5-2390T; 8 GB DDR3-1333 RAM; 128GB SanDisk Z400s SSD (OS); SanDisk Ultra II 480GB SDSSDHII480G SSD (primary storage); WD Blue 1TB WD10EZEX x2 in RAID 1 (backup storage).
    • Can you supply your config as it's entered in the GUI? I remember having a heck of a time with it and did what you seem to be doing - trying to come up with a serial configuration because NUT's (age old) doc's seemed to focus on it. I meant to write up a how-to, because the process to get it work was less than "intuitive".
      _________________________________________________

      I found that a dirt simple config and the right driver got me off the ground. I used this page to find the right driver.

      Here's my config:



      The port=auto statement got the USB connection to work.
      Good backup takes the "drama" out of computing
      ____________________________________
      Primary: OMV 3.0.99, ThinkServer TS140, 12GB ECC, 32GB USB boot, 4TB+4TB zmirror, 3TB client backup.
      Backup: OMV 4.1.9, Acer RC-111, 4GB, 32GB USB boot, 3TB+3TB zmirror, 4TB Rsync'ed disk
      2nd Data Backup: OMV 3.0.99, R-PI 2B, 16GB boot, 4TB WD USB MyPassport - direct connect (no hub)
    • The interface seems largely unchanged since OMV 2.x.

      The configuration is from the 'Driver configuration directives' field in the interface.

      The rest of the options shouldn't have any bearing on the posted directives, which I have used for a very, very long time. The last time I redid my NUT config was in 2015, and haven't touched it since.

      OMV 4.1.4-1 (Arrakis); Shuttle XPC SH67H3; Intel Core i5-2390T; 8 GB DDR3-1333 RAM; 128GB SanDisk Z400s SSD (OS); SanDisk Ultra II 480GB SDSSDHII480G SSD (primary storage); WD Blue 1TB WD10EZEX x2 in RAID 1 (backup storage).

      The post was edited 2 times, last by openletter ().

    • I missed the config in the first window. It appears you actually have a serial port. Given that you had a proven config, you may have something else going on.

      I find these lines interesting:
      1. Apr 08 09:59:45 HomeServer upsdrvctl[4218]: - Use another port (with the right permissions)
      2. Apr 08 09:59:45 HomeServer upsdrvctl[4218]: - Fix the port owner/group or permissions on this port
      3. Apr 08 09:59:45 HomeServer upsdrvctl[4218]: - Run this driver as another user (upsdrvctl -u or 'us
      On the permissions angle - I looked at /dev/bus/usb/001 What I found there was root:root 0755 I don't know how it could get changed but it wouldn't hurt to look at the permissions for /dev/ttyS2. (Or even make it 777, everyone read/write)

      By chance, did this happen after an update?
      Good backup takes the "drama" out of computing
      ____________________________________
      Primary: OMV 3.0.99, ThinkServer TS140, 12GB ECC, 32GB USB boot, 4TB+4TB zmirror, 3TB client backup.
      Backup: OMV 4.1.9, Acer RC-111, 4GB, 32GB USB boot, 3TB+3TB zmirror, 4TB Rsync'ed disk
      2nd Data Backup: OMV 3.0.99, R-PI 2B, 16GB boot, 4TB WD USB MyPassport - direct connect (no hub)
      1. Apr 08 10:22:22 HomeServer upsdrvctl[6594]: Unable to open /dev/ttyS2: Permission denied
      2. Apr 08 10:22:22 HomeServer upsdrvctl[6594]: Current user id: nut (113)
      3. Apr 08 10:22:22 HomeServer upsdrvctl[6594]: Serial port owner: root (0)
      4. Apr 08 10:22:22 HomeServer upsdrvctl[6594]: Serial port group: dialout (20)
      5. Apr 08 10:22:22 HomeServer upsdrvctl[6594]: Mode of port: 0660
      The above seems to lay it out.

      0660, in this case, is root:dialout . Both (owner:group) are read/write. If the current user is "nut", access is denied.
      Edit: (If user nut is NOT in the dialout group.)

      Would 0777 be the correct fix? Maybe not, but it would eliminate the permission denied issue.
      Good backup takes the "drama" out of computing
      ____________________________________
      Primary: OMV 3.0.99, ThinkServer TS140, 12GB ECC, 32GB USB boot, 4TB+4TB zmirror, 3TB client backup.
      Backup: OMV 4.1.9, Acer RC-111, 4GB, 32GB USB boot, 3TB+3TB zmirror, 4TB Rsync'ed disk
      2nd Data Backup: OMV 3.0.99, R-PI 2B, 16GB boot, 4TB WD USB MyPassport - direct connect (no hub)

      The post was edited 1 time, last by flmaxey: edit ().

    • Yeah, but I have to say that 777 has always been my least favorite resolution. Seems like the problem should be resolved somewhere else.
      OMV 4.1.4-1 (Arrakis); Shuttle XPC SH67H3; Intel Core i5-2390T; 8 GB DDR3-1333 RAM; 128GB SanDisk Z400s SSD (OS); SanDisk Ultra II 480GB SDSSDHII480G SSD (primary storage); WD Blue 1TB WD10EZEX x2 in RAID 1 (backup storage).
    • Okay, I figured out a fix.

      I noticed one of the ttyS* ports was member of group nut:

      # ls -alF /dev/ttyS*
      crw-rw---- 1 root nut 4, 64 Apr 8 15:38 ttyS0
      crw-rw---- 1 root dialout 4, 65 Apr 8 15:38 ttyS1
      crw-rw---- 1 root dialout 4, 66 Apr 8 15:38 ttyS2
      crw-rw---- 1 root dialout 4, 67 Apr 8 15:38 ttyS3

      I chowned ttyS2 to root:nut, and now everything works.

      The first time I loaded the configuration I copy pasted my old one, which was ttyS0, then later figured out it was ttyS2. I wonder if nut changed the group of ttyS0 on the first configuration load, but not later configurations?
      OMV 4.1.4-1 (Arrakis); Shuttle XPC SH67H3; Intel Core i5-2390T; 8 GB DDR3-1333 RAM; 128GB SanDisk Z400s SSD (OS); SanDisk Ultra II 480GB SDSSDHII480G SSD (primary storage); WD Blue 1TB WD10EZEX x2 in RAID 1 (backup storage).
    • openletter wrote:

      The first time I loaded the configuration I copy pasted my old one, which was ttyS0, then later figured out it was ttyS2. I wonder if nut changed the group of ttyS0 on the first configuration load, but not later configurations?
      Perhaps there was a script to sense the UPS on the first install, that set ttyS0. Thereafter, since it's "installed", reconfiguration might have been ignored. That would be a Dev oversight, but it seems reasonable.

      When you say, "figured out it was ttyS2"; was the cable moved after the initial install? Also I have to ask, how many physical serial ports does the Mobo have? Even one DB9 port is rare, lately.

      At least the error data pointed to permissions. You got it right - 0660 root:nut does it the right way, but I still think you'd have been OK with 0777. The PC would have to be connected to a modem on the physical port for 0777 to be risky.

      External modems,, museum pieces these days. (I think I might still have one in a box somewhere... :) )
      Good backup takes the "drama" out of computing
      ____________________________________
      Primary: OMV 3.0.99, ThinkServer TS140, 12GB ECC, 32GB USB boot, 4TB+4TB zmirror, 3TB client backup.
      Backup: OMV 4.1.9, Acer RC-111, 4GB, 32GB USB boot, 3TB+3TB zmirror, 4TB Rsync'ed disk
      2nd Data Backup: OMV 3.0.99, R-PI 2B, 16GB boot, 4TB WD USB MyPassport - direct connect (no hub)

      The post was edited 1 time, last by flmaxey: edit ().

    • The cable was never moved.

      Most motherboards still have a COM header, which is what this motherboard has. And a lot of networking focused boards have an RJ45 COM port.
      OMV 4.1.4-1 (Arrakis); Shuttle XPC SH67H3; Intel Core i5-2390T; 8 GB DDR3-1333 RAM; 128GB SanDisk Z400s SSD (OS); SanDisk Ultra II 480GB SDSSDHII480G SSD (primary storage); WD Blue 1TB WD10EZEX x2 in RAID 1 (backup storage).
    • openletter wrote:


      Most motherboards still have a COM header
      Hum, I hadn't noticed that. I'll have to look at my Mobo's spec's.
      Good backup takes the "drama" out of computing
      ____________________________________
      Primary: OMV 3.0.99, ThinkServer TS140, 12GB ECC, 32GB USB boot, 4TB+4TB zmirror, 3TB client backup.
      Backup: OMV 4.1.9, Acer RC-111, 4GB, 32GB USB boot, 3TB+3TB zmirror, 4TB Rsync'ed disk
      2nd Data Backup: OMV 3.0.99, R-PI 2B, 16GB boot, 4TB WD USB MyPassport - direct connect (no hub)