[Nut-upsdev] Tiny suggestion for upslog.c

Charles Lepple clepple at gmail.com
Wed Dec 10 14:27:07 UTC 2014


Hi Andy,

On Dec 8, 2014, at 7:07 PM, Andy Juniper <ajuniper at freeuk.com> wrote:

> It adds a signal handler for the USR1 signal, which simply triggers it to abort the current sleep and log the requested now.

I will admit that I'm not an expert on how signals interrupt system calls on all systems, but for what it's worth, the code looks good to me. Is it correct to assume that you are using this on Linux?

> I find it useful because my upssched-cmd can then killall -USR1 upslog to ensure that there is an entry in the log for brief power dropouts which would otherwise be unrecorded (because the power is only off for a few seconds).

Agreed, that sounds very useful.

I don't think we have a standard format for documenting the signals that the various NUT components respond to. However, I wouldn't want this feature to remain undocumented. Would you mind writing up a paragraph for the man page, in docs/man/upslog.txt? We currently describe how the sleep(3) times are approximate, but this could go in there as well.

Thanks,

-- 
Charles Lepple
clepple at gmail






More information about the Nut-upsdev mailing list