Project

General

Profile

Actions

Task #5039

closed

Move socket file to /run on Linux

Added by Davide Pesavento about 5 years ago. Updated over 4 years 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

Actions #1

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.

Actions #2

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.

Actions #3

Updated by Eric Newberry almost 5 years ago

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

Actions #4

Updated by Eric Newberry over 4 years ago

  • Assignee set to Eric Newberry
Actions #5

Updated by Eric Newberry over 4 years ago

  • Status changed from New to In Progress
Actions #6

Updated by Eric Newberry over 4 years ago

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

Actions #7

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.

Actions #8

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

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

Actions #10

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.

Actions #11

Updated by Eric Newberry over 4 years ago

  • Status changed from Code review to Closed
Actions #12

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?

Actions #13

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.

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

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

Actions

Also available in: Atom PDF