unstack.sh leaves the terminal garbled
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
devstack |
Fix Released
|
Low
|
Bence Romsics |
Bug Description
For some time (I did not record when this started) unstack.sh leaves my terminal garbled. In the middle of its run, carriage returns become broken. After it completes, terminal echo is off. Here's unstack.sh output where it gets garbled (I hope launchpad keeps the whitespace so the problem can be seen):
+functions-
+functions-
+lib/neutron-
+lib/neutron-
/home/rubasov/
Clearly it gets broken by this line:
https:/
The bug remains present even if I replace that line with:
sudo pkill -9 -f no-such-process || :
This gave me the hunch that pkill may be killing itself. However "man 1 pkill" claims:
"The running pgrep, pkill, or pidwait process will never report itself as a match."
After turning on process accounting, I realized that "sudo pkill" does not kill the "pkill" process but the "sudo" process:
$ sudo apt install acct
$ sudo accton on
$ unstack.sh
...
+lib/neutron-
/home/rubasov/
...
$ sudo dump-acct /var/log/
sudo |v3| 0.00| 0.00| 0.00| 1000| 0| 14416.00| 0.00| 336085| 331695|S X| 0|pts/1 |Mon Dec 12 11:04:55 2022
Clearly "pkill -f" is needed for this bug to happen. And it seems to me that sending the KILL/9 signal is also necessary.
Therefore this probably affects all occurrences of "sudo pkill -9 -f". I found two, here's the other one:
There are still multiple pieces I do not understand:
* A standalone "sudo pkill -9 -f" is not enough to reproduce the bug (or to kill sudo).
* How killing sudo leaves the terminal garbled.
But at this point I can propose a fix, which I will upload soon.
Changed in devstack: | |
assignee: | nobody → Bence Romsics (bence-romsics) |
Fix proposed to branch: master /review. opendev. org/c/openstack /devstack/ +/867215
Review: https:/