freifunk / openwrt-packages

Freifunk specific global OpenWrt Packages
Apache License 2.0
26 stars 33 forks source link

olsr_watchdog: handle empty "stamp" files #52

Closed SvenRoederer closed 3 years ago

SvenRoederer commented 3 years ago

I've seen a olsrd that have been killed as of OoM. It happened in a way, that the stamp-file of the watchdog-plugin did not store the epoch. This missing epoch made the script fail with

/usr/bin/lua: /usr/sbin/ff_olsr_watchdog:42: bad argument #1 to 'tonumber' (value expected)
stack traceback:
      [C]: in function 'tonumber'
      /usr/sbin/ff_olsr_watchdog:42: in main chunk

To satisfy tonumber() just return nil in such situations and consider it as died olsr.