MODUNLOAD(8) Maintenance Commands and Procedures MODUNLOAD(8)

modunloadUnload a module

modunload [-e exec_file] module_name | -i module_id

The modunload utility unloads a loadable module from the running system. The module_name or module_id are the name or ID, respectively, of the module as shown by modinfo(8).

If 0 is specified for module_id, an unload of any autoloaded modules will be attempted. Modules loaded by modload(8) are not affected.

Either module_name or -i module_id must specified in the arguments.

The following options are supported:

exec_file
Specify the name of a shell script or executable image file to be executed before the module is unloaded. The first argument passed is the module id (in decimal). The second argument depends on the type of the module:
Drivers
Driver major number
System calls
System call number
Exec classes
Index into the execsw table
Filesystems
Index into the vfssw table.
Streams modules
Index into the fmodsw table
Scheduling classes
Index into the class array
All others
Value of -1, since the argument does not apply
module_id
Specifies the ID of the module to be unloaded.

The following operands are supported:

module_name
Specifies the name of the module to be unloaded.

0
Successful completion.
>0
Failure.

Example 1 Unloading a module of ID

# modunload -i 123

Example 2 Unloading a module with name

# modunload some_driver

attributes(7), modinfo(8), modload(8), update_drv(8)

The modunload command is often used on driver modules to force the system to reread the associated driver configuration file. While this works in the current illumos release, it is not the supported way to reread the configuration file and is not guaranteed to work in future releases. The supported way for rereading driver configuration file is through the update_drv(8) command.

February 10, 2025 OmniOS