如何使用 Intel 6300esb 设置 Linux 看门狗守护进程

如何使用 Intel 6300esb 设置 Linux 看门狗守护进程

我已经在 Google 上搜索了这个问题一段时间了,但还没有找到关于如何将我的 6300esb 看门狗定时器的内核驱动程序连接到 /dev/watchdog 并确保看门狗守护进程保持其处于活动状态的正确文档。

顺便说一下,我在 KVM 虚拟机中使用与 RHEL 兼容的 Scientific Linux 6.3

以下是我迄今为止尝试过的一切:

dmesg|grep 6300
i6300ESB timer: Intel 6300ESB WatchDog Timer Driver v0.04
i6300ESB timer: initialized (0xffffc900008b8000). heartbeat=30 sec (nowayout=0)

|

ll /dev/watchdog
crw-rw----. 1 root root 10, 130 Sep 22 22:25 /dev/watchdog

|

/etc/watchdog.conf

#ping           = 172.31.14.1
#ping           = 172.26.1.255
#interface      = eth0
file            = /var/log/messages
#change         = 1407

# Uncomment to enable test. Setting one of these values to '0' disables it.
# These values will hopefully never reboot your machine during normal use
# (if your machine is really hung, the loadavg will go much higher than 25)
max-load-1      = 24
max-load-5      = 18
max-load-15     = 12

# Note that this is the number of pages!
# To get the real size, check how large the pagesize is on your machine.
#min-memory     = 1

#repair-binary      = /usr/sbin/repair
#test-binary        = 
#test-timeout       = 

watchdog-device = /dev/watchdog

# Defaults compiled into the binary
#temperature-device =
#max-temperature    = 120

# Defaults compiled into the binary
#admin          = root
interval        = 10
#logtick                = 1

# This greatly decreases the chance that watchdog won't be scheduled before
# your machine is really loaded
realtime        = yes
priority        = 1

# Check if syslogd is still running by enabling the following line
#pidfile        = /var/run/syslogd.pid   

现在也许我没有正确地测试它,但我预计停止看门狗服务会导致 /dev/watchdog 在 30 秒后超时,并且我应该看到主机重新启动,但这并没有发生。

另外,这是我的 KVM 虚拟机配置

<!--
WARNING: THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT ARE LIKELY TO BE 
OVERWRITTEN AND LOST. Changes to this xml configuration should be made using:
  virsh edit sl6template
or other application using the libvirt API.
-->

<domain type='kvm'>
  <name>sl6template</name>
  <uuid>960d0ac2-2e6a-5efa-87a3-6bb779e15b6a</uuid>
  <memory unit='KiB'>262144</memory>
  <currentMemory unit='KiB'>262144</currentMemory>
  <vcpu placement='static'>1</vcpu>
  <os>
    <type arch='x86_64' machine='rhel6.3.0'>hvm</type>
    <boot dev='hd'/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <pae/>
  </features>
  <cpu mode='custom' match='exact'>
    <model fallback='allow'>Westmere</model>
    <vendor>Intel</vendor>
    <feature policy='require' name='tm2'/>
    <feature policy='require' name='est'/>
    <feature policy='require' name='vmx'/>
    <feature policy='require' name='ds'/>
    <feature policy='require' name='smx'/>
    <feature policy='require' name='ss'/>
    <feature policy='require' name='vme'/>
    <feature policy='require' name='dtes64'/>
    <feature policy='require' name='rdtscp'/>
    <feature policy='require' name='ht'/>
    <feature policy='require' name='dca'/>
    <feature policy='require' name='pbe'/>
    <feature policy='require' name='tm'/>
    <feature policy='require' name='pdcm'/>
    <feature policy='require' name='pdpe1gb'/>
    <feature policy='require' name='ds_cpl'/>
    <feature policy='require' name='pclmuldq'/>
    <feature policy='require' name='xtpr'/>
    <feature policy='require' name='acpi'/>
    <feature policy='require' name='monitor'/>
    <feature policy='require' name='aes'/>
  </cpu>
  <clock offset='utc'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <devices>
    <emulator>/usr/libexec/qemu-kvm</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw'/>
      <source file='/mnt/data/vms/sl6template.img'/>
      <target dev='vda' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </disk>
    <controller type='usb' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
    </controller>
    <interface type='bridge'>
      <mac address='52:54:00:44:57:f6'/>
      <source bridge='br0.2'/>
      <model type='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
    <interface type='bridge'>
      <mac address='52:54:00:88:0f:42'/>
      <source bridge='br1'/>
      <model type='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
    </interface>
    <serial type='pty'>
      <target port='0'/>
    </serial>
    <console type='pty'>
      <target type='serial' port='0'/>
    </console>
    <watchdog model='i6300esb' action='reset'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </watchdog>
    <memballoon model='virtio'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </memballoon>
  </devices>
</domain>

任何帮助都将不胜感激,因为我发现最多的是 kvm 补丁和通用 softdog 文档或 IPMI 看门狗答案。

答案1

你的问题的答案是看门狗手册页

如果设备 /dev/watchdog 正确关闭,则可以停止看门狗守护进程而不会导致重新启动,除非您的内核在编译时启用了 CONFIG_WATCHDOG_NOWAYOUT 选项。

由于根据您的日志消息未设置 CONFIG_WATCHDOG_NOWAYOUT:

i6300ESB timer: initialized (0xffffc900008b8000). heartbeat=30 sec (nowayout=0)

那么关闭看门狗守护进程不会产生您想要的结果。所以现在您知道该怎么做了。

相关内容