Fix PermissionError caused by shared /tmp/buskill.log across users#109
Fix PermissionError caused by shared /tmp/buskill.log across users#109Raihan93-coder wants to merge 2 commits into
Conversation
|
Hey @Raihan93-coder, thanks for the PR Unfortunately, I realized that we don't yet have a process for contributors. I'm currently in the process of fixing that here: Please note that we also have a policy not to include contributions from AI: Can you please indicate if you wrote this code yourself, or if you used AI to write this code? |
|
@Raihan93-coder can you please send us an email so we can send you the CAA? |
|
The code and the implementation ( I took inspiration from you ) is solely
written by me
The commenting as well as the PR request generated is done by AI ( Lazy to
write 😅 )
…On Mon, 25 May 2026, 4:34 am Michael Altfield, ***@***.***> wrote:
*maltfield* left a comment (BusKill/buskill-app#109)
<#109 (comment)>
@Raihan93-coder <https://github.com/Raihan93-coder> can you please send
us an email so we can send you the CAA?
- https://buskill.in/contact
—
Reply to this email directly, view it on GitHub
<#109 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BLS5YWJ2NIOUIDVDGKG333L44N5Y7AVCNFSM6AAAAACZK4GMTCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHM2DKMZQGQ2DKMRZGY>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
|
I just told AI to give me the PR after giving it my git diff command and that is how the PR was generated and the code, I don't have enough tokens for this big of a project nor CLAUDE CODE. So you can 100% trust me the code is written by me and also the fallback logic ( implementation of cache_dir only after the initialization of setupdatadir ) was found by me when I was trying to run i got error if no buskill.log file was created it led to an outofbound error in logger.root.handlers[0] which was caused as there was no writable user specific cache dir created ( so the program had to wait ✋️ ) |
|
Thanks. I confirmed that @Raihan93-coder has signed the BusKill CAA. So there's a couple issues with this PR:
Can you please create a new PR where [a] you've made the changes to the |
|
replacement pr: |
Summary
This PR fixes a startup failure caused by the global
/tmp/buskill.loglogfile when BusKill is executed by multiple users on the same system.Previously, BusKill initialized logging using:
This created a shared logfile at
/tmp/buskill.log. If BusKill was first executed by one user (for exampleroot) and later started by another user, the second user could encounter:Root Cause
The logfile path was globally shared across users and initialized before BusKill had created its user-specific
CACHE_DIR.Additionally, when BusKill was executed directly from source (
python3 src/main.py), logger handlers were not always initialized yet, causing fallback logging initialization issues.Changes Made
/tmp/buskill.loglogfile with a logfile stored inside the BusKill user cache directory:Added a safe fallback for cases where logger handlers are not yet initialized during direct script execution.
Delayed fallback logfile initialization until after
setupDataDir()has created a writable user-specificCACHE_DIR.Result
BusKill can now be started by different users on the same system without logfile permission conflicts.
I tested the fix successfully with:
python3 src/main.pywithout startup or logging errors.