[pve-devel] watchdog-mux.service stop, trigger restart

Alexandre DERUMIER aderumier at odiso.com
Tue Dec 15 12:32:42 CET 2015

I think this is because I have active connections in muxer

    int active_count = active_client_count();
    if (active_count > 0) {
        fprintf(stderr, "exit watchdog-mux with active connections\n");
    } else {
        fprintf(stderr, "clean exit\n");

What is the correct way to have a clean exit ? 

----- Mail original -----
De: "aderumier" <aderumier at odiso.com>
À: "pve-devel" <pve-devel at pve.proxmox.com>
Envoyé: Mardi 15 Décembre 2015 12:29:46
Objet: Re: [pve-devel] watchdog-mux.service stop, trigger restart

seem that it's already implemented in watchdog-mux 

static void 
if (watchdog_fd != -1) { 
if (write(watchdog_fd, "V", 1) == -1) { 
perror("write magic watchdog close"); 
if (close(watchdog_fd) == -1) { 
perror("write magic watchdog close"); 

watchdog_fd = -1; 

Don't known why it doesn't seem to work for me. 

(If I launch a loop with "echo V > /dev/watchdog" ,it's working fine, watchdog is stopped) 

----- Mail original ----- 
De: "aderumier" <aderumier at odiso.com> 
À: "pve-devel" <pve-devel at pve.proxmox.com> 
Envoyé: Mardi 15 Décembre 2015 12:07:16 
Objet: [pve-devel] watchdog-mux.service stop, trigger restart 


i'm seeing that stopping the watchdog-mux service cleaning, trigger the watchdog reset. 

I think this could happen on package update (windows size of 10s is really short) 

>From the watchdog doc, 


it's possible to implement "Magic Close feature" 

If a driver supports "Magic Close", the driver will not disable the 
watchdog unless a specific magic character 'V' has been sent to 
/dev/watchdog just before closing the file. If the userspace daemon 
closes the file without sending this special character, the driver 
will assume that the daemon (and userspace in general) died, and will 
stop pinging the watchdog without disabling it first. This will then 
cause a reboot if the watchdog is not re-opened in sufficient time." 

pve-devel mailing list 
pve-devel at pve.proxmox.com 

More information about the pve-devel mailing list