Bug 1993983 - wdctl not picking up reboot reason flag
Summary: wdctl not picking up reboot reason flag
Keywords:
Status: POST
Alias: None
Product: Fedora
Classification: Fedora
Component: util-linux
Version: rawhide
Hardware: Unspecified
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Karel Zak
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 2057046
TreeView+ depends on / blocked
 
Reported: 2021-08-16 13:39 UTC by Jose
Modified: 2022-02-22 15:49 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 2057046 (view as bug list)
Environment:
Last Closed:
Type: Bug
Embargoed:


Attachments (Terms of Use)
Proposed patch (1.99 KB, application/mbox)
2021-08-16 13:39 UTC, Jose
no flags Details

Description Jose 2021-08-16 13:39:22 UTC
Created attachment 1814440 [details]
Proposed patch

Description of problem: `wdctl` does not show reboot reason flags when current boot was watchdog triggered.


Version-Release number of selected component (if applicable): 2.36.2 and earlier


How reproducible: Always.


Steps to Reproduce:
1. Install the watchdog daemon: yum install watchdog
2. Uncomment this line in /etc/watchdog.conf: watchdog-device = /dev/watchdog
3. Start the daemon: systemctl start watchdog.service
4. As root, do `echo c > /proc/sysrq-trigger`. This will cause a kernel panic.
5. Wait for the watchdog to reboot the system.
6. Once booted, run `sudo wdctl`.

Actual results:

Example from a VM:
```
[jose@fedora ~]$ sudo wdctl 
Device: /dev/watchdog0
Identity: i6300ESB timer [version 0]
Timeout: 30 seconds
Pre-timeout: 0 seconds
FLAG DESCRIPTION STATUS BOOT-STATUS
KEEPALIVEPING Keep alive ping reply 1 0
MAGICCLOSE Supports magic close char 0 0
SETTIMEOUT Set timeout (in seconds) 0 0
```

Expected results:
```
$ sudo wdctl
Device: /dev/watchdog0
Identity: i6300ESB timer [version 0]
Timeout: 30 seconds
Pre-timeout: 0 seconds
FLAG DESCRIPTION STATUS BOOT-STATUS
CARDRESET Card previously reset the CPU 1 1
KEEPALIVEPING Keep alive ping reply 1 0
MAGICCLOSE Supports magic close char 0 0
SETTIMEOUT Set timeout (in seconds) 0 0
```

Additional info:

Hans De Goede made a patch for this (attached). This patch is what I used in order to get the result provided in `Expected results`.

Comment 1 Karel Zak 2021-08-18 09:50:05 UTC
Applied to the upstream tree http://github.com/karelzak/util-linux/commit/b1b0259fe42aad1bf0997ce1c03a020ce59e38ab


Note You need to log in before you can comment on or make changes to this bug.