UPS problem - no shutdown - no email

Status
Not open for further replies.

Stoerte

Cadet
Joined
Aug 23, 2011
Messages
4
Hi,

i'm using an APC Back-UPS Pro 900 via USB. Connection seems to be fine but FreeNAS 8 didn't shutdown after UPS goes on battery and i didn't get an email notification.

Here are the details:

FreeNAS build: FreeNAS-8.0.4-RELEASE-p2-x64 (11367)
UPS: APC Back-UPS Pro 900 (connected via USB 2.0)


UPS Config (Web-GUI)
Code:
Identifier: ups
Driver: APC ups 2 Back-UPS Pro USB USB (usbhid-ups)
Port: /dev/ugen0.3
Shutdown mode: UPS goes on battery
Shutdown timer: 30
UPS Master User Password: fixmepass
Send Email Status Updates: checked
To email: my email adress
Email subject: UPS report generated by %h




Output from /var/log/messages: cat /var/log/messages | grep ups
Code:
Jun 22 16:37:43 freenas freenas[1833]: Executing: /usr/sbin/service ix-ups quietstart
Jun 22 16:37:43 freenas upsd[1655]: mainloop: Interrupted system call
Jun 22 16:37:43 freenas freenas: Connected to UPS [ups]: usbhid-ups-ups
Jun 22 16:37:43 freenas freenas[1833]: Executing: /usr/sbin/service nut_upsmon restart
Jun 22 16:37:43 freenas freenas: Stopping nut_upsmon.
Jun 22 16:37:43 freenas upsmon[1667]: upsmon parent: read
Jun 22 16:37:43 freenas freenas: Starting nut_upsmon.
Jun 22 16:37:43 freenas freenas: UPS: ups (master) (power value 1)
Jun 22 16:37:43 freenas freenas[1833]: Executing: /usr/sbin/service nut_upslog restart
Jun 22 16:37:43 freenas freenas: Stopping nut_upslog.
Jun 22 16:37:43 freenas freenas: Starting nut_upslog.
Jun 22 16:37:44 freenas freenas[1833]: Executing: /bin/pgrep -F /var/db/nut/upsd.pid upsd
Jun 22 16:37:49 freenas freenas[1833]: Executing: /usr/sbin/service ix-ups quietstart
Jun 22 16:37:50 freenas upsd[3155]: mainloop: Interrupted system call
Jun 22 16:37:50 freenas freenas[1833]: Executing: /usr/sbin/service nut_upsmon restart
Jun 22 16:37:50 freenas freenas: Stopping nut_upsmon.
Jun 22 16:37:50 freenas upsmon[3182]: upsmon parent: read
Jun 22 16:37:50 freenas freenas: Will not 'start' nut_upsmon because nut_upsmon_enable is NO.
Jun 22 16:37:50 freenas freenas[1833]: Executing: /usr/sbin/service nut_upslog restart
Jun 22 16:37:50 freenas freenas: Stopping nut_upslog.
Jun 22 16:37:50 freenas freenas: Will not 'start' nut_upslog because nut_upslog_enable is NO.
Jun 22 16:37:50 freenas freenas[1833]: Executing: /bin/pgrep -F /var/db/nut/upsd.pid upsd
Jun 22 16:38:05 freenas freenas[1833]: Executing: /usr/sbin/service ix-ups quietstart
Jun 22 16:38:05 freenas freenas: nut not running? (check /var/db/nut/upsd.pid).
Jun 22 16:38:05 freenas freenas: Connected to UPS [ups]: usbhid-ups-ups
Jun 22 16:38:05 freenas freenas[1833]: Executing: /usr/sbin/service nut_upsmon restart
Jun 22 16:38:05 freenas freenas: nut_upsmon not running? (check /var/db/nut/upsmon.pid).
Jun 22 16:38:05 freenas freenas: Starting nut_upsmon.
Jun 22 16:38:05 freenas freenas: UPS: ups (master) (power value 1)
Jun 22 16:38:05 freenas freenas[1833]: Executing: /usr/sbin/service nut_upslog restart
Jun 22 16:38:06 freenas freenas: nut_upslog not running? (check /var/db/nut/upslog.pid).
Jun 22 16:38:06 freenas freenas: Starting nut_upslog.
Jun 22 16:38:06 freenas freenas[1833]: Executing: /bin/pgrep -F /var/db/nut/upsd.pid upsd
Jun 22 16:38:26 freenas upsmon[3595]: UPS ups on battery
Jun 22 16:40:46 freenas upsmon[3595]: UPS ups on line power


As one can see FreeNAS detects at 16:38 that the UPS is on battery, but didn't do a shutdown as expected. After 2 minutes i put the power-cord back to the device and at 16:40 FreeNAS detects it (UPS ups on line power).

What can i do that FreeNAS shuts down my server after 30 seconds when it detects that the UPS is on battery?

Thanks in advance.

stoerte
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
Try upgrading to 8.0.4-P3. I'm not sure if they fixed it in 8.04, but they made some database changes that broke UPS notification etc.

I haven't been able to test if the fix made it into 8.2.0 Beta-4 yet either.
 

Stoerte

Cadet
Joined
Aug 23, 2011
Messages
4
Updated to 8.0.4 p3 (sorry i thought i updated the system a few days before)...

with all the same settings as above i still get no shutdown and no email :-((.

Here is a log with version 8.0.4 p3 (i took away the power cord from the device and put it back after a while). upsmon recognized it but no shutdown...

cat /var/log/messages | grep ups
Code:
Jun 22 23:38:27 freenas freenas[1806]: Executing: /usr/sbin/service ix-ups quietstart
Jun 22 23:38:27 freenas freenas: nut not running? (check /var/db/nut/upsd.pid).
Jun 22 23:38:27 freenas freenas: Connected to UPS [ups]: usbhid-ups-ups
Jun 22 23:38:27 freenas freenas[1806]: Executing: /usr/sbin/service nut_upsmon restart
Jun 22 23:38:27 freenas freenas: nut_upsmon not running? (check /var/db/nut/upsmon.pid).
Jun 22 23:38:27 freenas freenas: Starting nut_upsmon.
Jun 22 23:38:27 freenas freenas: UPS: ups (master) (power value 1)
Jun 22 23:38:27 freenas freenas[1806]: Executing: /usr/sbin/service nut_upslog restart
Jun 22 23:38:27 freenas freenas: nut_upslog not running? (check /var/db/nut/upslog.pid).
Jun 22 23:38:27 freenas freenas: Starting nut_upslog.
Jun 22 23:38:27 freenas freenas[1806]: Executing: /bin/pgrep -F /var/db/nut/upsd.pid upsd
Jun 22 23:40:32 freenas upsmon[3078]: UPS ups on battery
Jun 22 23:43:42 freenas upsmon[3078]: UPS ups on line power



~# dmesg | grep ugen0.3
Code:
ugen0.3: <American Power Conversion> at usbus0
ugen0.3: <American Power Conversion> at usbus0
ugen0.3: <American Power Conversion> at usbus0
ugen0.3: <American Power Conversion> at usbus0
ugen0.3: <American Power Conversion> at usbus0


Something else i can do?
 

Stoerte

Cadet
Joined
Aug 23, 2011
Messages
4
first of all, thanks for your help!!

I did following your links and made the changes to my system.

After chown the freenas-v1.db and rebooting i get this in terminal..

Code:
[root@freenas] /data# ls -la
total 1123
drwxr-xr-x   5 root  wheel        512 Jun 23 11:06 ./
drwxr-xr-x  20 root  wheel        512 Jun 13 17:02 ../
drwxrwxr-x   2 root  operator     512 Feb 29 02:58 .snap/
-rw-r--r--   1 root  wheel     168960 Apr 11 20:32 factory-v1.db
-rw-r-----   1 root  operator  182272 Jun 23 11:06 freenas-v1.db
-rw-r--r--   1 root  wheel     182272 Jun 22 23:34 freenas-v1.db.bak
-rw-r--r--   1 root  wheel     587393 Jun 23 11:02 rrd_dir.tar.bz2
drwxr-xr-x   2 root  wheel        512 Apr 11 20:32 ssh/
drwxr-xr-x   2 root  wheel        512 Jun 23 11:06 zfs/


Seems to be o.k., read access for the group operator.

Adding uucp to group operator with

Code:
pw groupmod operator -M uucp


i get this

Code:
[root@freenas] /data# pw groupshow operator
operator:*:5:uucp


Seems also to be o.k.

But after rebooting i get this
Code:
[root@freenas] /data# pw groupshow operator
operator:*:5:


the user uucp isn't member of operator anymore?!?

So after unplug the power cord i get the same "no shutdown - no mail"

Code:
Jun 23 10:40:13 freenas upsmon[1668]: UPS ups on battery
Jun 23 10:42:58 freenas upsmon[1668]: UPS ups on line power



i also did

Code:
pw groupmod operator -M uucp


and unplug the power cord without rebooting before and get the same behavior.



BUT....now it works.

I added uucp to the group operator via Web-GUI and this setting survives a reboot. Now i get an email and the server shuts down after it gets the signal from the UPS.


So finally, i did the following.

1. as root in terminal (via SSH).

Code:
chown root:operator /data/freenas-v1.db


2. via Web-GUI

Code:
Account -- Groups --- operator [members] --- under Selected (right side) uucp



Hope they will fix this little settings problem in the near future.
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
Glad to hear those links were enough to help. As you discovered the command line stuff doesn't stick because all the user/group info is stored in the database, so you figured out the correct thing to do was make the changes from the GUI.

I think the correct thing to do instead of chrpg'ing the database to operator, would have been to add operator to the wheel group? (Sorry I don't have a system handy to check how things are) But the bottom line is that you got it to work!

The developers are aware of the problem, I just don't think they were aware the fix didn't get backported into the 8.04 branch.

Someone else opened a ticket with another issue related to the database permissions problem. I added a comment about your problem in to it, so hopefully it will get noticed.


-- Proto
 
Status
Not open for further replies.
Top