Bug 15913

Summary: watchdog suggests can specify reboot time in ms, when only seconds handled
Product: Busybox Reporter: Daniel Griscom <griscom>
Component: OtherAssignee: unassigned
Status: NEW ---    
Severity: minor CC: busybox-cvs
Priority: P5    
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Host: Target:
Build:

Description Daniel Griscom 2024-01-16 15:19:21 UTC
The watchdog applet's help text and CLI strongly suggests that you can specify the reboot time down to ms:

> BusyBox v1.36.1 (2024-01-12 09:58:58 EST) multi-call binary.
> 
> Usage: watchdog [-t N[ms]] [-T N[ms]] [-F] DEV
> 
> Periodically write to watchdog device DEV
> 
> 	-T N	Reboot after N seconds if not reset (default 60)
> 	-t N	Reset every N seconds (default 30)
> 	-F	Run in foreground
> 
> Use 500ms to specify period in milliseconds

(Using old version, but I confirmed this hasn't changed in latest version.)

However, the tool immediately divides the ms by 1000 and then uses that (as the watchdog API only supports seconds). This is confusing.

Suggestions:

1) Change the "-T" argument to only take integer seconds, and change help appropriately. This would be the cleanest solution, except that there are probably existing installations using "-T 10000ms" that would be broken.

2) Change help text to make it clear that the "-T" argument should be integer seconds:

> BusyBox v1.36.1 (2024-01-12 09:58:58 EST) multi-call binary.
> 
> Usage: watchdog [-t N[ms]] [-T N] [-F] DEV
> 
> Periodically write to watchdog device DEV
> 
> 	-T N	Reboot after N seconds if not reset (default 60)
> 	-t N	Reset every N seconds (default 30); add ms suffix to specify
>               period in milliseconds
> 	-F	Run in foreground