Bug 15913 - watchdog suggests can specify reboot time in ms, when only seconds handled
Summary: watchdog suggests can specify reboot time in ms, when only seconds handled
Status: NEW
Alias: None
Product: Busybox
Classification: Unclassified
Component: Other (show other bugs)
Version: unspecified
Hardware: All All
: P5 minor
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-01-16 15:19 UTC by Daniel Griscom
Modified: 2024-01-16 15:19 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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