NetworkBlockDevice / nbd

Network Block Device
GNU General Public License v2.0
452 stars 119 forks source link

Fwd: Shouldn't nbd automatically load the kernel module? #56

Closed cheese closed 7 years ago

cheese commented 7 years ago

Description of problem: When installing the nbd package, there is nothing that automatically loads the kernel module nbd when using the nbd@.service. The module is needed for the client side to work.

Version-Release number of selected component (if applicable): nbd-3.16.1-1.fc26.x86_64

How reproducible: Every time.

Steps to Reproduce:

  1. systemctl start nbd@...

Actual results: The service fails.

Expected results: Successfully activation of the device.

Additional info: I'm not sure if this is intentional or not. I worked around it by adding a file in /etc/modules-load.d, and then things work fine. Most services don't need that kind of additional help to work, however, so I felt it could be worth a report.

I can see reasons not to add this to all systems installing nbd. After all, only the client side needs the module. Perhaps a ExecStartPre configuration running "modprobe nbd" in the nbd@.service file, or would that be too ugly.

As I said, maybe this is intentional. Feel free to close immediately with "won't fix" if so.

yoe commented 7 years ago

On Fri, Sep 22, 2017 at 11:55:03PM -0700, Robin Lee wrote:

Description of problem: When installing the nbd package, there is nothing that automatically loads the kernel module nbd when using the nbd@.service. The module is needed for the client side to work. [...] Additional info: I'm not sure if this is intentional or not. I worked around it by adding a file in /etc/modules-load.d, and then things work fine.

That's what you should do, yes.

Most services don't need that kind of additional help to work, however, so I felt it could be worth a report.

Most of those services would be autoloaded when the kernel senses they are required. E.g., if you try to configure an IPv6 address, and the IPv6 module isn't loaded, the kernel detects that additional modules are required and tells userspace to please do the right thing.

The necessary hooks to make this possible for NBD just don't exist.

I can see reasons not to add this to all systems installing nbd. After all, only the client side needs the module. Perhaps a ExecStartPre configuration running "modprobe nbd" in the nbd@.service file, or would that be too ugly.

That would also fail when someone tries to use NBD on a system that has the NBD module compiled into the kernel rather than as a module. Let's not go there.

-- Could you people please use IRC like normal people?!?

-- Amaya Rodrigo Sastre, trying to quiet down the buzz in the DebConf 2008 Hacklab

cheese commented 7 years ago

OK. As a downstream we can choose the modprobe approach since nbd is always compiled as module in Fedora kernel.