Closed niwza closed 6 years ago
Hi, Taras! You're absolutely right. Currently, this role does nothing to guarantee required permissions and ownership of watchdog device after system reboots. Although the Patroni daemon itself will start up smoothly even if watchdog is inaccessible (if default mode is used in the configuration file), wrong permissions/ownership would surely lead to undesirable consequences when watchdog support is a strict requirement, so definitely it is a bug and has to be fixed. But rather than writing a udev rule, I tend to patch the watchdog unit file or create an intermediate one like it is suggested here by folks from Cybertec. Please let me know if you have any objections. I will prepare a pull request soon. Thanks a lot @niwza for reporting this issue and for your attention to the project in general.
Haven't tested it with this playbook, but when I've been working with patroni and watchdog I've encountered situation that after system reboots /dev/watchdog ownership is switched back to the root user. And if you are running patroni with a different user (which you should) it fails to start because of /dev/watchdog permissions. So I had to add a udev rule to chown it back to patroni user on system startup.
Might be a good idea for You to check this scenario. Looks like softdog module is not persistent with your setup also. So it will not load on startup.