-
Bug
-
Resolution: Not a Bug
-
Undefined
-
None
-
rhel-8.10, rhel-9.6
-
None
-
No
-
Low
-
1
-
rhel-base-utils-core
-
1
-
False
-
False
-
-
None
-
Red Hat Enterprise Linux
-
BaseUtilsC Sprint CY25_00
-
None
-
None
-
Unspecified
-
Unspecified
-
Unspecified
-
None
If the user execute less then hit the "F" (follow file), the file being monitored is polled regularly to get updates.
If the user first added a trap to ignore SIGHUP before executing less, then closed the terminal abruptly, this leads to still having less monitor the file "in the background", despite the user not having a session anymore, instead of quitting.
Reproducer
- Open a terminal
- Set a trap to ignore SIGHUP
$ trap "" HUP
- Execute less on a file
$ less some_file
- Hit "F" to follow
- Close abruptly the terminal
Expected result
less exits on its own.
Actual result
less remains in the background:
# ps -eaf | grep less | grep -v grep
root 6427 6372 0 13:05 ? 00:00:00 less anaconda-ks.cfg
# strace -fttTvyy -s 128 -p 6427
strace: Process 6427 attached
13:06:00.084445 restart_syscall(<... resuming interrupted nanosleep ...>) = 0 <0.178072>
13:06:00.262753 read(4</root/anaconda-ks.cfg>, "", 6614) = 0 <0.000090>
13:06:00.263119 nanosleep({tv_sec=1, tv_nsec=0}, 0x7ffddb156c20) = 0 <1.000318>
13:06:01.263715 read(4</root/anaconda-ks.cfg>, "", 6614) = 0 <0.000070>
13:06:01.264066 nanosleep({tv_sec=1, tv_nsec=0}, 0x7ffddb156c20) = 0 <1.000232>
...
The reason for behavior is SIGHUP is ignored, IMHO less code should restore the default handler for SIGHUP.
- relates to
-
RHEL-105322 Hitting "F" (to follow changes) then closing abruptly the terminal leads to spinning on the CPU
-
- In Progress
-