Task #5039
closedMove socket file to /run on Linux
100%
Description
/var/run
[1] is considered legacy on Linux, the replacement is /run
[2]. systemd v239+ started complaining about services and other unit files using /var/run
. We should migrate to the new path, and ndn-cxx should look for the socket file in /run
first (on Linux only).
On most, if not all, modern Linux distros /var/run
is a symbolic link to /run
, so I don't expect any disruption.
[1] https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch05s13.html
[2] https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch03s15.html
Updated by Alex Afanasyev about 5 years ago
This is not an issue for the NFD... this is packaging system. If you talking about default config, then we cannot really change it (or need to make system-dependent), as there is no such thing on mac.
Updated by Davide Pesavento about 5 years ago
Yes, I'm talking about the configuration file and whatever other default we have in the code. And yes, this is for Linux only.
Updated by Eric Newberry over 4 years ago
So is the issue with changing this that /run not exist on macOS?
Updated by Eric Newberry over 4 years ago
- Status changed from New to In Progress
Updated by Eric Newberry over 4 years ago
How do we handle config files that refer to /var/run/nfd.sock?
Updated by Davide Pesavento over 4 years ago
What do you mean by "handle"? Whatever value appears in the config file takes precedence over the (hardcoded) default.
Updated by Eric Newberry over 4 years ago
- Target version set to 22.02
Davide Pesavento wrote:
What do you mean by "handle"? Whatever value appears in the config file takes precedence over the (hardcoded) default.
Sorry, I mean the default. By default, the config file refers to /var/run/nfd.sock
. I see four possible solutions (please let me know what you think of each):
- (a) Have different default config files for each platform (seems difficult and error-prone, especially with keeping the two versions consistent).
- (b) Perform some processing at compile-time to put different defaults for each platform in the config file (seems like overkill).
- (c) Leave
/var/run/nfd.sock
in the config file, since this still works on Linux due to the symbolic link, and have the hardcoded default in the code be platform-specific (easiest). - (d) Leave
/var/run/nfd.sock
in the config file, but comment it out so that the hardcoded platform-specific path in code is used by default (my preferred solution, seems easy and not hacky - can also add a comment indicating default values for each platform in the config file).
Updated by Davide Pesavento over 4 years ago
We already do (b) so it's not overkill, and in fact it would be trivial to add the socket path to that existing logic. (d) is fine as well. (a) is unmaintainable and strictly worse than (b). (c) is pointless.
In summary, I'd be ok with either (b) or (d).
Updated by Eric Newberry over 4 years ago
- Status changed from In Progress to Code review
- % Done changed from 0 to 100
I went with option (b), as discussed above.
Updated by Eric Newberry over 4 years ago
- Status changed from Code review to Closed
Updated by Davide Pesavento over 4 years ago
Can you please open a ticket with CCL and python-ndn to inform them of the change?
Updated by Eric Newberry over 4 years ago
Davide Pesavento wrote:
Can you please open a ticket with CCL and python-ndn to inform them of the change?
Done.