1.\" $NetBSD: wdogctl.8,v 1.28 2022/09/23 12:35:00 riastradh Exp $ 2.\" 3.\" Copyright (c) 2000 Zembu Labs, Inc. 4.\" All rights reserved. 5.\" 6.\" Author: Jason R. Thorpe <thorpej@zembu.com> 7.\" 8.\" Redistribution and use in source and binary forms, with or without 9.\" modification, are permitted provided that the following conditions 10.\" are met: 11.\" 1. Redistributions of source code must retain the above copyright 12.\" notice, this list of conditions and the following disclaimer. 13.\" 2. Redistributions in binary form must reproduce the above copyright 14.\" notice, this list of conditions and the following disclaimer in the 15.\" documentation and/or other materials provided with the distribution. 16.\" 3. All advertising materials mentioning features or use of this software 17.\" must display the following acknowledgement: 18.\" This product includes software developed by Zembu Labs, Inc. 19.\" 4. Neither the name of Zembu Labs nor the names of its employees may 20.\" be used to endorse or promote products derived from this software 21.\" without specific prior written permission. 22.\" 23.\" THIS SOFTWARE IS PROVIDED BY ZEMBU LABS, INC. ``AS IS'' AND ANY EXPRESS 24.\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WAR- 25.\" RANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DIS- 26.\" CLAIMED. IN NO EVENT SHALL ZEMBU LABS BE LIABLE FOR ANY DIRECT, INDIRECT, 27.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 28.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 29.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 30.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 31.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 32.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33.\" 34.Dd July 11, 2020 35.Dt WDOGCTL 8 36.Os 37.Sh NAME 38.Nm wdogctl 39.Nd Watchdog timer control utility 40.Sh SYNOPSIS 41.Nm 42.Nm 43.Fl d 44.Nm 45.Fl e 46.Op Fl A 47.Op Fl p Ar seconds 48.Ar timer 49.Nm 50.Fl k 51.Op Fl A 52.Op Fl p Ar seconds 53.Ar timer 54.Nm 55.Fl t 56.Nm 57.Fl u 58.Op Fl A 59.Op Fl p Ar seconds 60.Ar timer 61.Nm 62.Fl x 63.Op Fl A 64.Op Fl p Ar seconds 65.Ar timer 66.Sh DESCRIPTION 67.Nm 68is used to manipulate watchdog timers. 69A watchdog timer is a hardware or software timer that resets the system 70if it fails to make progress within a prescribed period. 71To prevent the system from being reset, something must refresh the 72timer to prevent it from expiring. 73.Pp 74A hardware watchdog timer asserts system's hardware reset signal when 75it expires. 76A software watchdog timer calls the kernel's s normal reboot path. 77.Pp 78The 79.Nx 80kernel provides three modes in which watchdog timers may 81operate: kernel tickle mode, user tickle mode, and external tickle mode. 82.Bl -tag 83.It kernel tickle mode 84A timer in the kernel refreshes the watchdog timer. 85This ensures kernel threads can make progress within the period of the 86watchdog timer. 87.It user tickle mode 88.Nm 89runs in the background and refreshes the watchdog timer. 90This ensures user programs can make progress within the period of the 91watchdog timer. 92.Pp 93Note that user tickle mode must be used with caution; 94on a heavily loaded system, the timer may 95expire accidentally, even though user programs may be making 96(very slow) progress. 97A user-mode timer is disarmed (if possible) when the device is closed, 98unless the timer is activated with the 99.Fl x 100option. 101.It external tickle mode 102Similar to user tickle mode, except that the tickle must be done 103explicitly by a separate invocation of 104.Nm Fl t . 105This allows users to determine the activity whose progress the watchdog 106timer checks. 107.El 108.Pp 109In kernel and user tickle modes, an attempt is made to refresh the 110watchdog timer in one half the timer's configured period. 111For example, if the watchdog timer has a period of 30 seconds, a 112refresh attempt is made every 15 seconds. 113.Pp 114If called without arguments, 115.Nm 116will list the timers available on the system. 117When arming a watchdog timer, the 118.Ar timer 119argument is the name of the timer to arm. 120.Pp 121Only one timer may be armed at a time; if an attempt is made 122to arm a timer when one is already armed, an error message 123will be displayed and no action will be taken. 124.Pp 125The options are as follows: 126.Bl -tag -width Fl 127.It Fl A 128When arming a timer, this flag indicates that an audible alarm is 129to sound when the watchdog timer expires and resets the system. 130If the selected timer does not support an audible alarm, this 131option will be silently ignored. 132.It Fl d 133This flag disarms the currently active timer. 134Note that not all watchdog timers can be disabled once armed. 135If the selected timer can not be disabled, 136an error message will be displayed and the 137timer will remain armed. 138.It Fl e 139Arm 140.Ar timer 141in external tickle mode. 142.It Fl k 143Arm 144.Ar timer 145in kernel tickle mode. 146.It Fl p Ar period 147When arming a timer, this flag configures the timer period to 148.Ar period 149seconds. 150If the specified period is outside the timer's range, 151an error message will be displayed and no action will be taken. 152.It Fl t 153This flag tickles an external mode timer. 154.It Fl u 155Arm 156.Ar timer 157in user tickle mode. 158.It Fl x 159Arm 160.Ar timer 161in a modified user tickle mode: closing the device will not disarm 162the timer. 163.El 164.Sh FILES 165.Bl -tag -width ".Pa /dev/watchdog" 166.It Pa /dev/watchdog 167the system monitor watchdog timer device 168.El 169.Sh SEE ALSO 170.Xr acpiwdrt 4 , 171.Xr evbarm/iopwdog 4 , 172.Xr i386/elansc 4 , 173.Xr i386/gcscpcib 4 , 174.Xr i386/geodewdog 4 , 175.Xr ipmi 4 , 176.Xr itesio 4 , 177.Xr pcweasel 4 , 178.Xr pwdog 4 , 179.Xr swwdog 4 , 180.Xr x86/tco 4 181.Sh HISTORY 182The 183.Nm 184command first appeared in 185.Nx 1.6 . 186.Sh AUTHORS 187The 188.Nm 189command and the 190.Nx 191watchdog timer framework were written by 192.An Jason R. Thorpe 193.Aq thorpej@zembu.com , 194and contributed by Zembu Labs, Inc. 195