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

NAME


modunload - Unload a module

SYNOPSIS


modunload [-e exec_file] module_name | -i module_id

DESCRIPTION


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.

OPTIONS


The following options are supported:

-e 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

-i module_id Specifies the ID of the module to be unloaded.

OPERANDS


The following operands are supported:

module_name Specifies the name of the module to be unloaded.

EXIT STATUS


0 Successful completion.

>0 Failure.

EXAMPLES


Example 1 Unloading a module of ID 123

# modunload -i 123

Example 2 Unloading a module with name some_driver

# modunload some_driver

SEE ALSO


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

NOTES


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.

illumos February 10, 2025 illumos

tribblix@gmail.com :: GitHub :: Privacy