Datera / targetcli

CLI and shell for the Linux SCSI Target
http://linux-iscsi.org/wiki/targetcli
Apache License 2.0
52 stars 21 forks source link

Hide un-needed modules in targetcli #6

Open ExecDevOps opened 9 years ago

ExecDevOps commented 9 years ago

The targetcli user interface shows all modules loaded by the kernel, even those that one never will use. Also, when starting the "target" service it gives an error message related to "usb_gadget".

These annoyances can be avoided by moving the targetcli modules out of reach for /etc/rc.d/init.d/target simply by renaming the module files. Run the following snippet (all on one line) in a command shell with root privileges:

for MODULE in {"ib_srpt","qla2xxx","tcm_fc","usb_gadget","vhost"}; do mv /var/target/fabric/$MODULE.spec /var/target/fabric/$MODULE.spec.inactive; done

Now when the service starts it will not find the renamed modules and only load the remaining, i.e. iscsi. Less clutter in the ui and no more error message for "usb_gadget" when the server starts.

This works on CentOS 6.5 (with the latest mainline kernel from elrepo: 3.17.0-1.el6.elrepo.x86_64).

tramjoe commented 9 years ago

I agree that moduel loading should be friendly and smarter. However moving the specfiles is probably not ther best way to do it :-) I plan to add more checks for non-existing fabric modules, as well as hiding fabric modules for hardware that is not installed. Thanks for the report.