It appears that the ozwdaemon doesn't handle the USB device going away. I haven't tested this outside of docker, maybe it handles better with the container layer removed.
I'd be happy if the ozwdaemon exited with an error like it does if the MQTT server goes away but this healthcheck makes it easier to have something restart the container if it goes unhealthy.
Before removing device:
root@9876af95778d:~# ls -l $USB_PATH
crw-rw---- 1 root 16 166, 0 Jan 29 17:30 /dev/zwave
root@9876af95778d:/opt/ozw# head $USB_PATH
root@9876af95778d:/opt/ozw#
after removing USB device
root@9876af95778d:~# ls -l $USB_PATH
crw-rw---- 1 root 16 166, 0 Jan 29 17:30 /dev/zwave
root@9876af95778d:~# head $USB_PATH
head: cannot open '/dev/zwave' for reading: No such device
after re-inserting USB device
root@9876af95778d:~# ls -l $USB_PATH
crw-rw---- 1 root 16 166, 0 Jan 29 17:30 /dev/zwave
root@9876af95778d:~# head $USB_PATH
head: cannot open '/dev/zwave' for reading: No such device
It appears that the ozwdaemon doesn't handle the USB device going away. I haven't tested this outside of docker, maybe it handles better with the container layer removed.
I'd be happy if the ozwdaemon exited with an error like it does if the MQTT server goes away but this healthcheck makes it easier to have something restart the container if it goes unhealthy.
Before removing device:
after removing USB device
after re-inserting USB device
Related to #198