Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

networkmanager: leave thunderbolt rule alone, it's builtin #53905

Merged

Conversation

dtzWill
Copy link
Member

@dtzWill dtzWill commented Jan 13, 2019

Motivation for this change

As-is I'm seeing errors in log an invalid rule:

Jan 09 11:05:24 dtznix systemd-udevd[556]: Invalid rule /nix/store/fcqa36rd10d5rjcbv7xbwmzrvdi6wd90-udev-rules/90-nm-thunderbolt.rules:8: RUN{builtin}: '/nix/store/h6m6nj56v9q4jqhc8vqhqy27qzhkgprs-kmod-25/bin/kmod load thunderbolt-net' unknown

However with this change (using stock upstream version of this file),
the error is gone-- presumably kmod is how to specify the builtin?

Grep'ing (ripgrep anyway) for other uses of builtin in my system's
udev rules suggests there are no other instances where absolute path
is given and just the tool name in the handful of cases it IS used.
YMMV, of course.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@jtojnar
Copy link
Contributor

jtojnar commented Jan 14, 2019

As per the manual page, it looks you are right:

RUN{type}

Add a program to the list of programs to be executed after processing all the rules for a specific event, depending on "type":

"program"

Execute an external program specified as the assigned value. If no absolute path is given, the program is expected to live in /usr/lib/udev; otherwise, the absolute path must be specified.

This is the default if no type is specified.

"builtin"

As program, but use one of the built-in programs rather than an external one.

The program name and following arguments are separated by spaces. Single quotes can be used to specify arguments with spaces.

This can only be used for very short-running foreground tasks. Running an event process for a long period of time may block all further events for this or a dependent device.

Starting daemons or other long-running processes is not appropriate for udev; the forked processes, detached or not, will be unconditionally killed after the event handling has finished.

Note that running programs that access the network or mount/unmount filesystems is not allowed inside of udev rules, due to the default sandbox that is enforced on systemd-udevd.service.

@dtzWill
Copy link
Member Author

dtzWill commented Jan 16, 2019

(okay to merge then, yes? just double-checking :))

@dtzWill dtzWill merged commit 2ba1485 into NixOS:master Jan 16, 2019
@dtzWill dtzWill deleted the fix/nm-thudnerbolt-dont-use-abs-path-for-builtin branch January 16, 2019 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants