Project

General

Profile

Task #5039

Move socket file to /run on Linux

Added by Davide Pesavento 7 months ago. Updated about 2 months ago.

Status:
Closed
Priority:
Low
Assignee:
Category:
Faces
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:

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

#1

Updated by Alex Afanasyev 7 months 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.

#2

Updated by Davide Pesavento 7 months 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.

#3

Updated by Eric Newberry 4 months ago

So is the issue with changing this that /run not exist on macOS?

#4

Updated by Eric Newberry 2 months ago

  • Assignee set to Eric Newberry
#5

Updated by Eric Newberry 2 months ago

  • Status changed from New to In Progress
#6

Updated by Eric Newberry 2 months ago

How do we handle config files that refer to /var/run/nfd.sock?

#7

Updated by Davide Pesavento 2 months ago

What do you mean by "handle"? Whatever value appears in the config file takes precedence over the (hardcoded) default.

#8

Updated by Eric Newberry 2 months ago

  • Target version set to v0.8

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).
#9

Updated by Davide Pesavento 2 months 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).

#10

Updated by Eric Newberry 2 months ago

  • Status changed from In Progress to Code review
  • % Done changed from 0 to 100

I went with option (b), as discussed above.

#11

Updated by Eric Newberry about 2 months ago

  • Status changed from Code review to Closed
#12

Updated by Davide Pesavento about 2 months ago

Can you please open a ticket with CCL and python-ndn to inform them of the change?

#13

Updated by Eric Newberry about 2 months ago

Davide Pesavento wrote:

Can you please open a ticket with CCL and python-ndn to inform them of the change?

Done.

https://redmine.named-data.net/issues/5099

https://github.com/zjkmxy/python-ndn/issues/6

Also available in: Atom PDF