FS#74342 - [lua-language-server] Place tmpfiles under parent directory

Attached to Project: Community Packages
Opened by Adrian (adrian5) - Monday, 04 April 2022, 12:04 GMT
Last edited by Daniel M. Capella (polyzen) - Friday, 14 July 2023, 22:56 GMT
Task Type Feature Request
Category Packages
Status Closed
Assigned To Caleb Maclennan (alerque)
Daniel M. Capella (polyzen)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Currently every start of the server adds a temporary directory to `/tmp`. I find that in daily use this quick pollutes the directory with lots of instances, since it doesn't clean up after itself.

I'd prefer if the `/usr/bin/lua-language/server` startup script placed them under a parent directory, i.e.

mkdir /tmp/lua-language-server
TMPPATH=$(mktemp -d "/tmp/lua-language-server/instance.XXXX")

Then it can grow ad infinitum hidden within that directory.
This task depends upon

Closed by  Daniel M. Capella (polyzen)
Friday, 14 July 2023, 22:56 GMT
Reason for closing:  Implemented
Additional comments about closing:  3.6.23-2
Comment by Caleb Maclennan (alerque) - Thursday, 07 April 2022, 18:21 GMT
The fact that it doesn't clean up after itself sounds like a bigger problem than the /tmp pollution. Is there an upstream issue reporting *that* problem yet?
Comment by Adrian (adrian5) - Thursday, 22 September 2022, 00:56 GMT
My impression is that the old instances being kept around is intentional; in particular due to the log files the contain. Assuming that lua-language-server isn't built with specific output paths in mind, and that the `/usr/bin/lua-language-server` script discussed here is a creation of the Arch Linux package, I think the correction should be made there.

`mkdir -p /tmp/lua-language-server` is probably better in the above snippet.
Comment by Adrian (adrian5) - Wednesday, 18 January 2023, 00:09 GMT
Caleb, would you reconsider this?

1. The current directory choice appears to be Arch-specific, not application defaults we'd diverge from.
2. Even if a cleanup option existed, it may not be wise to hardcode it, as users may want logs.

With a simple change, everything is contained in an application specific directory:

mkdir -p /tmp/lua-language-server # Create common dir for language server runtime output
TMPPATH=$(mktemp -d "/tmp/lua-language-server/instance.XXX") # Nest instances within dir

What's the downside?
Comment by Daniel M. Capella (polyzen) - Wednesday, 18 January 2023, 00:10 GMT
> 1. The current directory choice appears to be Arch-specific, not application defaults we'd diverge from.

This is actually common among a number of distros. Can't remember where it originated.
Comment by Adrian (adrian5) - Wednesday, 18 January 2023, 00:29 GMT
And the concern is that somebody relies on that behavior? It's not too unusual for Arch to pick "better" defaults that diverge from the mainstream or apply patches early. That's part of what I love about the distro. Right now I'd have:

/tmp/instance.oPt
/tmp/instance.nNx
/tmp/instance.rrK
/tmp/instance.FWe


And while some people consider /tmp to be a garbage heap, I'm not aware of any other applications that pollute the dir like that. This has happened (e.g. with lockfiles) but ends up getting fixed.
Comment by Daniel M. Capella (polyzen) - Wednesday, 18 January 2023, 00:31 GMT
> And the concern is that somebody relies on that behavior?

No, just a clarification.

Loading...