mirror of
https://git.proxmox.com/git/pve-ha-manager
synced 2025-04-28 22:08:10 +00:00
allow to configure watchdog module in /etc/default/pve-ha-manager
All watchdog modules are blacklisted, so we cannot load them via /etc/modules. Instead, watchdog-mux loads it at startup.
This commit is contained in:
parent
7ce093b0af
commit
6263c81dfe
2
debian/pve-ha-manager.default
vendored
Normal file
2
debian/pve-ha-manager.default
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
# select watchdog module (default is softdog)
|
||||
#WATCHDOG_MODULE=ipmi_watchdog
|
1
debian/watchdog-mux.service
vendored
1
debian/watchdog-mux.service
vendored
@ -2,6 +2,7 @@
|
||||
Description=Proxmox VE watchdog multiplexer
|
||||
|
||||
[Service]
|
||||
EnvironmentFile=-/etc/default/pve-ha-manager
|
||||
ExecStart=/usr/sbin/watchdog-mux
|
||||
OOMScoreAdjust=-1000
|
||||
Restart=no
|
||||
|
@ -1,3 +1,4 @@
|
||||
#define _GNU_SOURCE
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
@ -120,8 +121,18 @@ main(void)
|
||||
* options softdog soft_noboot=1
|
||||
*/
|
||||
if (stat(WATCHDOG_DEV, &fs) == -1) {
|
||||
char *wd_module = getenv("WATCHDOG_MODULE");
|
||||
if (wd_module) {
|
||||
char *cmd = NULL;
|
||||
if ((asprintf(&cmd, "modprobe -q %s", wd_module) == -1)) {
|
||||
perror("assemble modprobe command failed");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
system(cmd);
|
||||
} else {
|
||||
system("modprobe -q softdog"); // load softdog by default
|
||||
}
|
||||
}
|
||||
|
||||
if ((watchdog_fd = open(WATCHDOG_DEV, O_WRONLY)) == -1) {
|
||||
perror("watchdog open");
|
||||
|
Loading…
Reference in New Issue
Block a user