1*811e9ec7Sriastradh.\" $NetBSD: wdogctl.8,v 1.28 2022/09/23 12:35:00 riastradh Exp $ 2fb6f7d6fSthorpej.\" 3fb6f7d6fSthorpej.\" Copyright (c) 2000 Zembu Labs, Inc. 4fb6f7d6fSthorpej.\" All rights reserved. 5fb6f7d6fSthorpej.\" 6fb6f7d6fSthorpej.\" Author: Jason R. Thorpe <thorpej@zembu.com> 7fb6f7d6fSthorpej.\" 8fb6f7d6fSthorpej.\" Redistribution and use in source and binary forms, with or without 9fb6f7d6fSthorpej.\" modification, are permitted provided that the following conditions 10fb6f7d6fSthorpej.\" are met: 11fb6f7d6fSthorpej.\" 1. Redistributions of source code must retain the above copyright 12fb6f7d6fSthorpej.\" notice, this list of conditions and the following disclaimer. 13fb6f7d6fSthorpej.\" 2. Redistributions in binary form must reproduce the above copyright 14fb6f7d6fSthorpej.\" notice, this list of conditions and the following disclaimer in the 15fb6f7d6fSthorpej.\" documentation and/or other materials provided with the distribution. 16fb6f7d6fSthorpej.\" 3. All advertising materials mentioning features or use of this software 17fb6f7d6fSthorpej.\" must display the following acknowledgement: 18fb6f7d6fSthorpej.\" This product includes software developed by Zembu Labs, Inc. 19fb6f7d6fSthorpej.\" 4. Neither the name of Zembu Labs nor the names of its employees may 20fb6f7d6fSthorpej.\" be used to endorse or promote products derived from this software 21fb6f7d6fSthorpej.\" without specific prior written permission. 22fb6f7d6fSthorpej.\" 23fb6f7d6fSthorpej.\" THIS SOFTWARE IS PROVIDED BY ZEMBU LABS, INC. ``AS IS'' AND ANY EXPRESS 24fb6f7d6fSthorpej.\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WAR- 25fb6f7d6fSthorpej.\" RANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DIS- 26fb6f7d6fSthorpej.\" CLAIMED. IN NO EVENT SHALL ZEMBU LABS BE LIABLE FOR ANY DIRECT, INDIRECT, 27fb6f7d6fSthorpej.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 28fb6f7d6fSthorpej.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 29fb6f7d6fSthorpej.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 30fb6f7d6fSthorpej.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 31fb6f7d6fSthorpej.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 32fb6f7d6fSthorpej.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33fb6f7d6fSthorpej.\" 34a2d60435Sjruoho.Dd July 11, 2020 35fb6f7d6fSthorpej.Dt WDOGCTL 8 3673f545bbSwiz.Os 37fb6f7d6fSthorpej.Sh NAME 38fb6f7d6fSthorpej.Nm wdogctl 39fb6f7d6fSthorpej.Nd Watchdog timer control utility 40fb6f7d6fSthorpej.Sh SYNOPSIS 41fb6f7d6fSthorpej.Nm 42990562bfSwiz.Nm 435bd1d870Swiz.Fl d 44990562bfSwiz.Nm 45ddd2ade2Ssmb.Fl e 46ddd2ade2Ssmb.Op Fl A 47ddd2ade2Ssmb.Op Fl p Ar seconds 48ddd2ade2Ssmb.Ar timer 49ddd2ade2Ssmb.Nm 505bd1d870Swiz.Fl k 515bd1d870Swiz.Op Fl A 525bd1d870Swiz.Op Fl p Ar seconds 535bd1d870Swiz.Ar timer 545bd1d870Swiz.Nm 55ddd2ade2Ssmb.Fl t 56ddd2ade2Ssmb.Nm 575bd1d870Swiz.Fl u 585bd1d870Swiz.Op Fl A 595bd1d870Swiz.Op Fl p Ar seconds 605bd1d870Swiz.Ar timer 61a79c18d7Sdyoung.Nm 62a79c18d7Sdyoung.Fl x 63a79c18d7Sdyoung.Op Fl A 64a79c18d7Sdyoung.Op Fl p Ar seconds 65a79c18d7Sdyoung.Ar timer 66fb6f7d6fSthorpej.Sh DESCRIPTION 67fb6f7d6fSthorpej.Nm 6809cbac4eSwizis used to manipulate watchdog timers. 6930c75eaaSriastradhA watchdog timer is a hardware or software timer that resets the system 7030c75eaaSriastradhif it fails to make progress within a prescribed period. 7130c75eaaSriastradhTo prevent the system from being reset, something must refresh the 7230c75eaaSriastradhtimer to prevent it from expiring. 7330c75eaaSriastradh.Pp 7430c75eaaSriastradhA hardware watchdog timer asserts system's hardware reset signal when 7530c75eaaSriastradhit expires. 7630c75eaaSriastradhA software watchdog timer calls the kernel's s normal reboot path. 77fb6f7d6fSthorpej.Pp 78fb6f7d6fSthorpejThe 79fb6f7d6fSthorpej.Nx 8030c75eaaSriastradhkernel provides three modes in which watchdog timers may 81ddd2ade2Ssmboperate: kernel tickle mode, user tickle mode, and external tickle mode. 82*811e9ec7Sriastradh.Bl -tag 8330c75eaaSriastradh.It kernel tickle mode 8430c75eaaSriastradhA timer in the kernel refreshes the watchdog timer. 8530c75eaaSriastradhThis ensures kernel threads can make progress within the period of the 8630c75eaaSriastradhwatchdog timer. 8730c75eaaSriastradh.It user tickle mode 88fb6f7d6fSthorpej.Nm 8909cbac4eSwizruns in the background and refreshes the watchdog timer. 9030c75eaaSriastradhThis ensures user programs can make progress within the period of the 9130c75eaaSriastradhwatchdog timer. 9230c75eaaSriastradh.Pp 9309cbac4eSwizNote that user tickle mode must be used with caution; 9409cbac4eSwizon a heavily loaded system, the timer may 95fb6f7d6fSthorpejexpire accidentally, even though user programs may be making 96fb6f7d6fSthorpej(very slow) progress. 97a79c18d7SdyoungA user-mode timer is disarmed (if possible) when the device is closed, 98a79c18d7Sdyoungunless the timer is activated with the 99a79c18d7Sdyoung.Fl x 100a79c18d7Sdyoungoption. 10130c75eaaSriastradh.It external tickle mode 10230c75eaaSriastradhSimilar to user tickle mode, except that the tickle must be done 103*811e9ec7Sriastradhexplicitly by a separate invocation of 104*811e9ec7Sriastradh.Nm Fl t . 10530c75eaaSriastradhThis allows users to determine the activity whose progress the watchdog 10630c75eaaSriastradhtimer checks. 10730c75eaaSriastradh.El 108ddd2ade2Ssmb.Pp 10930c75eaaSriastradhIn kernel and user tickle modes, an attempt is made to refresh the 11030c75eaaSriastradhwatchdog timer in one half the timer's configured period. 11130c75eaaSriastradhFor example, if the watchdog timer has a period of 30 seconds, a 11230c75eaaSriastradhrefresh attempt is made every 15 seconds. 113fb6f7d6fSthorpej.Pp 114fb6f7d6fSthorpejIf called without arguments, 115fb6f7d6fSthorpej.Nm 11609cbac4eSwizwill list the timers available on the system. 11709cbac4eSwizWhen arming a watchdog timer, the 118fb6f7d6fSthorpej.Ar timer 119fb6f7d6fSthorpejargument is the name of the timer to arm. 120fb6f7d6fSthorpej.Pp 121fb6f7d6fSthorpejOnly one timer may be armed at a time; if an attempt is made 122fb6f7d6fSthorpejto arm a timer when one is already armed, an error message 123fb6f7d6fSthorpejwill be displayed and no action will be taken. 124fb6f7d6fSthorpej.Pp 125fb6f7d6fSthorpejThe options are as follows: 12630c75eaaSriastradh.Bl -tag -width Fl 127fb6f7d6fSthorpej.It Fl A 128fb6f7d6fSthorpejWhen arming a timer, this flag indicates that an audible alarm is 129fb6f7d6fSthorpejto sound when the watchdog timer expires and resets the system. 130fb6f7d6fSthorpejIf the selected timer does not support an audible alarm, this 131fb6f7d6fSthorpejoption will be silently ignored. 132fb6f7d6fSthorpej.It Fl d 13309cbac4eSwizThis flag disarms the currently active timer. 13409cbac4eSwizNote that not all watchdog timers can be disabled once armed. 13509cbac4eSwizIf the selected timer can not be disabled, 13609cbac4eSwizan error message will be displayed and the 1371384fef1Sthorpejtimer will remain armed. 1385bd1d870Swiz.It Fl e 1395bd1d870SwizArm 1405bd1d870Swiz.Ar timer 1415bd1d870Swizin external tickle mode. 1425bd1d870Swiz.It Fl k 1435bd1d870SwizArm 1445bd1d870Swiz.Ar timer 1455bd1d870Swizin kernel tickle mode. 1465bd1d870Swiz.It Fl p Ar period 1475bd1d870SwizWhen arming a timer, this flag configures the timer period to 1485bd1d870Swiz.Ar period 1495bd1d870Swizseconds. 1505bd1d870SwizIf the specified period is outside the timer's range, 1515bd1d870Swizan error message will be displayed and no action will be taken. 152ddd2ade2Ssmb.It Fl t 153ddd2ade2SsmbThis flag tickles an external mode timer. 1545bd1d870Swiz.It Fl u 1555bd1d870SwizArm 1565bd1d870Swiz.Ar timer 1575bd1d870Swizin user tickle mode. 158a79c18d7Sdyoung.It Fl x 159a79c18d7SdyoungArm 160a79c18d7Sdyoung.Ar timer 161a79c18d7Sdyoungin a modified user tickle mode: closing the device will not disarm 162a79c18d7Sdyoungthe timer. 163fb6f7d6fSthorpej.El 164fb6f7d6fSthorpej.Sh FILES 1657bdf691eSuwe.Bl -tag -width ".Pa /dev/watchdog" 16630c75eaaSriastradh.It Pa /dev/watchdog 16730c75eaaSriastradhthe system monitor watchdog timer device 16830c75eaaSriastradh.El 169fb6f7d6fSthorpej.Sh SEE ALSO 17021b4f7d5Sjmcneill.Xr acpiwdrt 4 , 17169f3168bSwiz.Xr evbarm/iopwdog 4 , 1729537f217Sxtraeme.Xr i386/elansc 4 , 173e0fef4a4Sxtraeme.Xr i386/gcscpcib 4 , 1749537f217Sxtraeme.Xr i386/geodewdog 4 , 1759537f217Sxtraeme.Xr ipmi 4 , 176a5381ad0Sxtraeme.Xr itesio 4 , 17790a0b7adSxtraeme.Xr pcweasel 4 , 178c52f77aeSmbalmer.Xr pwdog 4 , 1798daed3c3Swiz.Xr swwdog 4 , 180a2d60435Sjruoho.Xr x86/tco 4 181fb6f7d6fSthorpej.Sh HISTORY 182fb6f7d6fSthorpejThe 183fb6f7d6fSthorpej.Nm 184fb6f7d6fSthorpejcommand first appeared in 18534b397c5Shauke.Nx 1.6 . 1864136eb5cSwiz.Sh AUTHORS 187fb6f7d6fSthorpejThe 188fb6f7d6fSthorpej.Nm 189fb6f7d6fSthorpejcommand and the 190fb6f7d6fSthorpej.Nx 191fb6f7d6fSthorpejwatchdog timer framework were written by 192fb6f7d6fSthorpej.An Jason R. Thorpe 193fb6f7d6fSthorpej.Aq thorpej@zembu.com , 194fb6f7d6fSthorpejand contributed by Zembu Labs, Inc. 195