Well, that was an interesting thread. I'm punting that the following link
was your original lockup discussion.
https://groups.google.com/forum/#!msg/weewx-user/qzzcMoojY5I/qLEhUyuYBAAJ;context-place=msg/weewx-user/S1dOoMfgaXw/DYB9bc-EBAAJ


I can't offer any advice on the actual USB lockout - my WH108 has never
given any serious grief - and assuming there is no cleaner solution coming
from those more knowledgeable, then we end up at your reboot question.

You say  "periodically scan syslog and reboot if this message turns up."
Are you aware that you can use rsyslog itself to flag and act on that
message? ( I know you said no syslog, but you also mention cron and
scanning which suggest an external solution.)

https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/System_Administrators_Guide/s1-basic_configuration_of_rsyslog.html


READ WRITE : root@rorpi-2:~# tail /etc/rsyslog.conf

#
#daemon.*;mail.*;\
#    news.err;\
#    *.=debug;*.=info;\
#    *.=notice;*.=warn    |/dev/xconsole

$template weewxwatch,"%msg:::drop-last-lf%"
:msg, contains, "Caught WeeWxIOError: Cannot determine archive interval"
^/root/syslogalarm.sh; weewxwatch


then create /root/syslogalarm.sh and add the following as a testing
example...

#!/bin/bash
tymestamp=$(date +%d%m%Y-%H:%M)
logger "caught $0 execution"
echo "caught $0 execution @ $tymestamp" >> /root/weewxlogger.log

shutdown -k +2

exit 0

and make it executable with...
chmod 0700 /root/syslogalarm.sh

restart syslog...
/etc/init.d/rsyslog restart && tail -f /var/log/syslog

and from another terminal write to syslog using...

logger Caught WeeWxIOError: Cannot determine archive interval

and you should get a message informing you of an imminent shutdown (except
-k is a dummy run.)
Tweak to suit.



Cheers
 Glenn

rorpi-raspberry pi + weewx: now with scripts
<https://github.com/glennmckechnie/rorpi-raspberrypi>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to