Bug 12446

Summary: command-not found: treats typos as a syslog emergency (writes to all terminals and rings many bells)
Product: Mageia Reporter: Richard Neill <mageia>
Component: RPM PackagesAssignee: Mageia Bug Squad <bugsquad>
Status: RESOLVED OLD QA Contact:
Severity: normal    
Priority: Normal CC: fundawang, mageia, nic, thierry.vignaud
Version: CauldronKeywords: Triaged
Target Milestone: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Source RPM: packagekit-command-not-found-0.8.14-3.mga4 CVE:
Status comment:

Description Richard Neill 2014-01-27 01:59:20 CET
Consider, I might have 4 konsole tabs open.
Let's say I type the command "firefo" when I meant "firefox"

This causes:

* At least 4 different terminal bells to ring (as KDE's system bell sound)
* The pcspkr to beep 4 times
* Any remote SSH sessions to beep.
* A 4 second delay, followed by more multiple beeps and bips.
* Every terminal (including editors) gets irrelevant nonsense spat into it, twice, with a short delay.

I think command-not-found is logging into syslog at the EMERG level !

To reproduce:

------------------
$ firefo
bash: firefo: command not found...

Message from syslogd@chocolate at Jan 27 00:53:14 ...
 PackageKit: search-file transaction /387_eecedcca from uid 500 finished with failed after 4358ms
Failed to search for file: The backend exited unexpectedly. This is a serious error as the spawned backend did not complete the pending transaction.
$
------------------

The bash command-not-found function is calling the program /usr/libexec/pk-command-not-found, which is then  responsible for the mayhem.

This is quite funny - I can't think of anything less interesting to log than an ordinary user's typing error. Even failing disks don't alert the user this much (though I wish that they did!)





Reproducible: 

Steps to Reproduce:
Comment 1 Richard Neill 2014-01-27 02:10:49 CET
For extra fun... the symphony of beeps and gibberish repeats once more, 5 minutes and 2 seconds after the original error, as the search daemon dies.

-----
$ firefo
bash: firefo: command not found...

Message from syslogd@chocolate at Jan 27 01:02:38 ...
 PackageKit: daemon start
^C
$ 
Message from syslogd@chocolate at Jan 27 01:02:42 ...
 PackageKit: search-file transaction /389_eaaabead from uid 500 finished with failed after 4358ms

$ ^C
$ 
Message from syslogd@chocolate at Jan 27 01:07:44 ...
 PackageKit: daemon quit
--------
Manuel Hiebel 2014-01-28 18:35:18 CET

Keywords: (none) => Triaged
CC: (none) => fundawang, mageia, thierry.vignaud

Comment 2 Richard Neill 2014-02-18 18:27:01 CET
As of the most recent upgrade(*), the symphony of beeps has gone away.
But the command-not-found function now hangs indefinitely, until Ctrl-C.

$ time firefo
bash: firefo: command not found...
^C
real    1m6.798s
user    0m0.000s
sys     0m0.000s

(*) All updates to Mga4 have been applied with urpmi --auto-update + reboot, as of a few minutes ago. PackageKit version is now packagekit-0.8.14-3.1.mga4
Comment 3 Nic Baxter 2015-12-24 10:06:22 CET
I can't reproduce this in Mageia 5. firefo does not hang.

Hi, thanks for reporting this bug.
We are sorry, but we no longer maintains this version of Mageia. Please upgrade to the latest version and reopen this bug against that version if this bug exists there.
As a result we are setting this bug to CLOSED:OLD

Status: NEW => RESOLVED
CC: (none) => nic
Resolution: (none) => OLD