Jump to content

How to install, enable and start watchdog in H3


Go to solution Solved by rufik,

Recommended Posts

Posted

Try to add the following in the watchdog.service file. For me it works

ControlGroup=cpu:/
Spoiler

root@orangepipc:~# cat /lib/systemd/system/watchdog.service
[Unit]
Description=watchdog daemon
Conflicts=wd_keepalive.service
After=multi-user.target
OnFailure=wd_keepalive.service

[Service]
Type=forking
ControlGroup=cpu:/
EnvironmentFile=/etc/default/watchdog
ExecStartPre=/bin/sh -c '[ -z "${watchdog_module}" ] || [ "${watchdog_module}" = "none" ] || /sbin/modprobe $watchdog_module'
ExecStart=/bin/sh -c '[ $run_watchdog != 1 ] || exec /usr/sbin/watchdog $watchdog_options'
ExecStopPost=/bin/sh -c '[ $run_wd_keepalive != 1 ] || false'

[Install]
WantedBy=default.target

 

 

  • Solution
Posted
13 hours ago, lampra said:

Try to add the following in the watchdog.service file. For me it works


ControlGroup=cpu:/

 

 

This directive is deprecated now. But I've set realtime=no and this error has gone.

Posted

Hi There !

 

I have a Orange Pi 3 (H6 SOC I suppose) and I am trying to enable watchdog reset.

As far I can see, there is no kernel module for it, and, as result, there is no /dev/watchdog device file.

root@orangepi3:~# uname -a
Linux orangepi3 5.2.5-sunxi64 #5.92 SMP Fri Aug 2 07:51:38 CEST 2019 aarch64 aarch64 aarch64 GNU/Linux
root@orangepi3:~# lsmod  
Module                  Size  Used by
zstd                   16384  4
zram                   28672  2
btsdio                 16384  0
bluetooth             360448  2 btsdio
brcmfmac              204800  0
brcmutil               16384  1 brcmfmac
snd_soc_hdmi_codec     16384  0
snd_soc_core          135168  1 snd_soc_hdmi_codec
snd_pcm_dmaengine      16384  1 snd_soc_core
snd_pcm                94208  3 snd_soc_hdmi_codec,snd_soc_core,snd_pcm_dmaengine
snd_timer              32768  1 snd_pcm
snd                    57344  4 snd_soc_hdmi_codec,snd_timer,snd_soc_core,snd_pcm
soundcore              16384  1 snd
cfg80211              319488  1 brcmfmac
rfkill                 28672  5 bluetooth,cfg80211
sun50i_h6_ths          16384  0
cpufreq_dt             16384  0
realtek                20480  1
dw_hdmi_i2s_audio      16384  0
dw_hdmi_cec            16384  0
i2c_mv64xxx            20480  0
dwmac_sun8i            24576  0
mdio_mux               16384  1 dwmac_sun8i
root@orangepi3:~# ls /dev/watchdog
ls: cannot access '/dev/watchdog': No such file or directory
root@orangepi3:~# 

I've installed watchdog package and added the line "extraarg=sunxi_wdt.nowayout=1" to /boot/armbianEnv.txt

What am I missing ?

 


 

Posted
44 minutes ago, marozsas said:

As far I can see, there is no kernel module for it, and, as result, there is no /dev/watchdog device file.

I've my OPi3 with 5.3.0-rc3, and watchdog is compiled inside kernel, not as a module.

Therefore, I've the /dev/watchdog and "dmesg | grep -i watchdog" is reporting the following :

[    1.830851] sunxi-wdt 7020400.watchdog: Watchdog enabled (timeout=16 sec, nowayout=0)

 

Posted

hey guys,

can someone help me, maybe I forgot something. My watchdog.service doesn't work :(

 

watchdog.service - watchdog daemon
   Loaded: loaded (/lib/systemd/system/watchdog.service; enabled; vendor preset: ena
bled)
   Active: inactive (dead) since Mon 2019-10-28 23:58:27 CET; 15h ago
  Process: 2836 ExecStart=/bin/sh -c [ $run_watchdog != 1 ] || exec /usr/sbin/watchd
og $watchdog_options (code=exited, status=2)
  Process: 2833 ExecStartPre=/bin/sh -c [ -z "${watchdog_module}" ] || [ "${watchdog
_module}" = "none" ] || /sbin/modprobe $watchdog_module (code=exited, status=0/SUCCE
SS)
      CPU: 24ms

Warning: Journal has been rotated since unit was started. Log output is incomplete o
r unavailable.

 

echo 1 > /dev/watchdog

it works, orange pi zero restarts

my /etc/default/watchdog

# Start watchdog at boot time? 0 or 1
run_watchdog=1
# Start wd_keepalive after stopping watchdog? 0 or 1
run_wd_keepalive=1
# Load module before starting watchdog
watchdog_module="none"
# Specify additional watchdog options here (see manpage).

my /etc/watchdog.conf

ping                    = 1.1.1.1
ping                    = 192.168.178.1
interface               = wlan0
#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
#allocatable-memory     = 1

#repair-binary          = /usr/sbin/repair
#repair-timeout         = 60
test-binary             = /usr/local/bin/watchdog_led.sh
test-timeout            = 60

# The retry-timeout and repair limit are used to handle errors in a more robust
# manner. Errors must persist for longer than retry-timeout to action a repair
# or reboot, and if repair-maximum attempts are made without the test passing a
# reboot is initiated anyway.
#retry-timeout          = 60
#repair-maximum         = 1

watchdog-device = /dev/watchdog

# Defaults compiled into the binary
temperature-sensor      =/sys/class/thermal/thermal_zone0/temp 
max-temperature = 90

# Defaults compiled into the binary
#admin                  = root
interval                = 20
#logtick                = 1
#log-dir                = /var/log/watchdog

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

# Check if rsyslogd is still running by enabling the following line
#pidfile                = /var/run/rsyslogd.pid
pidfile         = /var/lib/zerotier-one/zerotier-one.pid

my  /etc/systemd/system.conf

RuntimeWatchdogSec=16
ShutdownWatchdogSec=10min

my /boot/armbianEnv.txt

verbosity=7
logo=disabled
console=none
disp_mode=1920x1080p60
overlay_prefix=sun8i-h3
overlays=usbhost2 usbhost3
rootdev=UUID=***
rootfstype=ext4
usbstoragequirks=0x2537:0x1066:u,0x2537:0x1068:u
extraarg=thiswatchdogparameter=value
extraarg=sunxi_wdt.nowayout=1

lsmod

Module                  Size  Used by
xt_nat                 16384  7
xt_tcpudp              16384  21
veth                   20480  0
xt_conntrack           16384  1
ipt_MASQUERADE         16384  8
nf_conntrack_netlink    32768  0
nfnetlink              16384  2 nf_conntrack_netlink
xt_addrtype            16384  2
iptable_filter         16384  1
iptable_nat            16384  1
nf_nat_ipv4            16384  2 ipt_MASQUERADE,iptable_nat
nf_nat                 24576  2 xt_nat,nf_nat_ipv4
nf_conntrack           77824  6 xt_nat,ipt_MASQUERADE,nf_conntrack_netlink,xt_conntrack,nf_nat_ipv4,nf_nat
nf_defrag_ipv6         16384  1 nf_conntrack
nf_defrag_ipv4         16384  1 nf_conntrack
br_netfilter           20480  0
aufs                  167936  0
aes_arm_bs             20480  0
crypto_simd            16384  1 aes_arm_bs
cryptd                 20480  1 crypto_simd
ccm                    20480  9
overlay                77824  5
sun8i_codec_analog     24576  0
sun8i_adda_pr_regmap    16384  1 sun8i_codec_analog
snd_soc_simple_card    16384  0
sun4i_i2s              20480  0
snd_soc_simple_card_utils    16384  1 snd_soc_simple_card
snd_soc_core          114688  4 sun4i_i2s,sun8i_codec_analog,snd_soc_simple_card_utils,snd_soc_simple_card
snd_pcm_dmaengine      16384  1 snd_soc_core
snd_pcm                69632  3 sun4i_i2s,snd_pcm_dmaengine,snd_soc_core
lima                   40960  0
xradio_wlan            94208  1
sun4i_gpadc_iio        16384  0
snd_timer              24576  1 snd_pcm
gpu_sched              20480  1 lima
snd                    45056  3 snd_timer,snd_soc_core,snd_pcm
ttm                    57344  1 lima
soundcore              16384  1 snd
industrialio           49152  1 sun4i_gpadc_iio
mac80211              450560  1 xradio_wlan
sun8i_ths              16384  0
cfg80211              393216  2 mac80211,xradio_wlan
cpufreq_dt             16384  0
uio_pdrv_genirq        16384  0
uio                    16384  1 uio_pdrv_genirq
thermal_sys            57344  3 cpufreq_dt,sun8i_ths,sun4i_gpadc_iio
usb_f_acm              16384  1
u_serial               20480  1 usb_f_acm
g_serial               16384  0
libcomposite           40960  2 g_serial,usb_f_acm
ip_tables              20480  2 iptable_filter,iptable_nat
x_tables               20480  7 xt_nat,ip_tables,iptable_filter,xt_tcpudp,ipt_MASQUERADE,xt_addrtype,xt_conntrack
pwrseq_simple          16384  1

 

Posted
22 hours ago, megusta said:

my  /etc/systemd/system.conf


RuntimeWatchdogSec=16
ShutdownWatchdogSec=10min

i figured out, this conflicts with watchdog.service.

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines