Dealing with uncooperative program file locations

Apologies if this is kinda hectic, but I’ve been at this for a couple hours now.
I’m trying to make a ghidra-server package/module, and I got the build (download) process working, but ghidra stores it’s logs/config in the installation folder which it can’t do for logs it’s in the nix store.
And for the config files it would make editing the config via a module (ie programs/service.ghidra-server._) impossible.
To change the log location I’d need to change the config file, and to change the config file location I’d need to change the script that starts the server.

So I have a couple questions:

  1. Is it good practice to patch decently big chunks of files or is it better to just download the modified script from somewhere (ie gist)?
  2. Where do I even put them in the end, I could make a folder in something like /var/ghidra, or is it better to point it to the home directory of the currently running user?

Hey there, welcome to the community!

  1. If the changes in question are so significant that they mean a file rewrite, I’d deploy it next to the package definition, as usually done with patch files.
  2. Personally I don’t think it matters much, but that sounds like material for a PR discussion. Why not just create a PR and see what people think?
1 Like

Logs often go into stdout if they’re being run as a daemon; that way journald can manage them. Stateful data files tend to go in /var/lib/$program/. Sometimes logs can go there.

2 Likes

Thank you for the quick responses.
I’ll create a PR when I clean it up a bit.