garrysmod-issues icon indicating copy to clipboard operation
garrysmod-issues copied to clipboard

Individual symbolic links don't work with autorefresh

Open Ethorbit opened this issue 2 months ago • 3 comments

Details

On a Linux server, if you create a symbolic link for each addon file

  1. autorefresh won't see any changes made to that addon
  2. lua_openscript won't load any changes

You basically have to restart the map every time

Steps to reproduce

  • Create two addon directories with identical directory structures.

    1. One for the Garry's Mod server mkdir -p /path/to/server/dir/addons
    2. The other for shared addons mkdir -p /path/to/shared/dir/addons

    Example:

    /home/steam/Steam/steamapps/common/GarrysModDS/garrysmod/addons

    /shared/GarrysModDS/garrysmod/addons

  • Place an addon inside the /path/to/shared/dir/addons

  • Automatically create symbolic links:

  • cp --preserve=timestamp -dRns "/path/to/shared/dir/"* "/path/to/server/dir/"

This command creates symbolic links (-s) for all files and directories from the shared folder into the server folder, preserving timestamps (-p), not overwriting existing files (-n), and recursively handling directories (-R).

  • Your server directory should now have addons from the shared directory. Go check.
  • Start the server
  • Edit an addon inside the shared directory (changes should automatically reflect in the server directory because of the symlinks)

Version of the game

Protocol version 24 Exe version 2025.03.26 (garrysmod) Exe build: 18:53:48 Jul 16 2025 (9748) (4000) GMod version 2025.07.23, branch: unknown Linux 32bit Dedicated Server

Beta

None/Public/Default/Main

Ethorbit avatar Oct 20 '25 21:10 Ethorbit

Related: https://github.com/Facepunch/garrysmod-issues/issues/5793

I believe there has been another regression.

Ethorbit avatar Oct 20 '25 21:10 Ethorbit

Looks like lua_refresh_file is reloading changes I make to my symlinked addons after updating my server.

Was this issue addressed?

Ethorbit avatar Dec 04 '25 02:12 Ethorbit

No, it was not looked into, otherwise there'd be a comment here saying so, or the issue would be closed as completed.

lua_refresh_file imitates what autorefresh would do when the OS sends GMod the notification that a file has changed.

Now, I may misunderstand something, but from what I can tell you are making symlinks for each individual file separately? That is not really the intended way the game expects you do this, it expects you to symlink folders, most commonly the individual addon folders inside addons/. Symlinking entire addons/ folder works too, at least on Windows in my personal experience.

That being said, the game does recursively subscribe to change events for all folders (not files) in addons/ (unless -disableluarefresh is used), so I don't really see why it wouldn't work for you.

robotboy655 avatar Dec 04 '25 03:12 robotboy655