Bug 509248 - Sudo password prompt on login due to a script in ~/.bash-profile causes boot hang
Summary: Sudo password prompt on login due to a script in ~/.bash-profile causes boot ...
Status: RESOLVED NOT A BUG
Alias: None
Product: plasmashell
Classification: Plasma
Component: Startup process (other bugs)
Version First Reported In: 6.4.4
Platform: Fedora RPMs Linux
: NOR minor
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-09-07 20:53 UTC by Sanmay
Modified: 2025-09-10 16:51 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sanmay 2025-09-07 20:53:49 UTC
Summary

Sudo password prompt on login due to a script in ~/.bash-profile causes boot hang.


Description

When a user includes a script in `~/.bash-profile` that requires `sudo` privileges, the system hangs on the Laptop Manufacturer (ASUS) loading screen after the user login window. The issue occurs after the user has logged in, leading to a situation where the user must input their password blindly to continue booting. It would be beneficial to have a visible password prompt instead of the current behavior.


Steps to Reproduce

1. Create a script in `~/.bash-profile` that requires `sudo` privileges.
2. Restart the system.
3. Observe the ASUS loading screen after the user login window.
4. Input the password blindly and press enter to resume booting.


Expected Behavior

A visible password prompt should appear when a script requiring `sudo` privileges is executed during the login process, rather than hanging on the loading screen.


Additional Information

- On boot, the `xwaylandbridge` quits unexpectedly.
- This issue has been observed on ASUS hardware.


Environment

Operating System: Fedora Linux 42
KDE Plasma Version: 6.4.4
KDE Frameworks Version: 6.17.0
Qt Version: 6.9.1
Kernel Version: 6.15.9-201.fc42.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 6 × 11th Gen Intel® Core™ i5-11400H @ 2.70GHz
Memory: 8 GiB of RAM (7.5 GiB usable)
Graphics Processor 1: Intel® UHD Graphics
Graphics Processor 2: NVIDIA GeForce RTX 3050 Laptop GPU
Manufacturer: ASUSTeK COMPUTER INC.
Product Name: ASUS TUF Gaming F15 FX506HC_FX506HC
System Version: 1.0
Comment 1 Nate Graham 2025-09-10 08:49:39 UTC
Unfortunately there's no way to improve this from the KDE side. `sudo` is a command-line tool that doesn't know how to display a GUI authentication prompt. So if there is none, it'll just ask invisibly into the ether, hanging forever. As such, this is unfortunately a configuration issue on your side that needs to be fixed there too.

If you replaced `sudo` with `run0` or `pkexec`, then it would do what you expect automatically, because those tools do know how to display a GUI authentication prompt.
Comment 2 Sanmay 2025-09-10 09:59:27 UTC
(In reply to Nate Graham from comment #1)
> Unfortunately there's no way to improve this from the KDE side. `sudo` is a
> command-line tool that doesn't know how to display a GUI authentication
> prompt. So if there is none, it'll just ask invisibly into the ether,
> hanging forever. As such, this is unfortunately a configuration issue on
> your side that needs to be fixed there too.
> 
> If you replaced `sudo` with `run0` or `pkexec`, then it would do what you
> expect automatically, because those tools do know how to display a GUI
> authentication prompt.
I presumed it as a bug because Linux Mint had prompted with the GUI authentication when a script with `sudo` was there in `.bash-profile`. But yeah, what you say makes sense.

Thanks. Will update my code.
Comment 3 Nate Graham 2025-09-10 10:01:32 UTC
Interesting, that's unexpected. I wonder what wizardry they do to make that happen. If you could find it, it would be useful to compare notes.
Comment 4 Sanmay 2025-09-10 16:51:02 UTC
(In reply to Nate Graham from comment #3)
> Interesting, that's unexpected. I wonder what wizardry they do to make that
> happen. If you could find it, it would be useful to compare notes.

I am not using Mint as of now and remembering out of memory. Will try to recreate that behavior in a VM and get back here.