'\" .\" The contents of this file are subject to the terms of the Common .\" Development and Distribution License (the "License"). You may not use this .\" file except in compliance with the License. .\" .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE .\" or http://www.opensolaris.org/os/licensing. .\" See the License for the specific language governing permissions .\" and limitations under the License. .\" .\" When distributing Covered Code, include this CDDL HEADER in each .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE. .\" If applicable, add the following below this CDDL HEADER, with the .\" fields enclosed by brackets "[]" replaced with your own identifying .\" information: Portions Copyright [yyyy] [name of copyright owner] .\" .\" Copyright (c) 2005, Sun Microsystems, Inc. .\" Copyright 2025 Oxide Computer Company .\" .Dd February 10, 2025 .Dt MODUNLOAD 8 .Os .Sh NAME .Nm modunload .Nd Unload a module .Sh SYNOPSIS .Nm .Op Fl e Ar exec_file .Ar module_name | Fl i Ar module_id .Sh DESCRIPTION The .Nm utility unloads a loadable module from the running system. The .Ar module_name or .Ar module_id are the name or ID, respectively, of the module as shown by .Xr modinfo 8 . .Pp If 0 is specified for .Ar module_id , an unload of any autoloaded modules will be attempted. Modules loaded by .Xr modload 8 are not affected. .Pp Either .Ar module_name or .Fl i Ar module_id must specified in the arguments. .Sh OPTIONS The following options are supported: .Bl -tag -width Ar .It Fl e Ar 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 .Pq in decimal . The second argument depends on the type of the module: .Bl -tag -width Ds .It Drivers Driver major number .It System calls System call number .It Exec classes Index into the .Va execsw table .It Filesystems Index into the .Va vfssw table. .It Streams modules Index into the .Vt fmodsw table .It Scheduling classes Index into the class array .It All others Value of -1, since the argument does not apply .El .It Fl i Ar module_id Specifies the ID of the module to be unloaded. .El .Sh OPERANDS The following operands are supported: .Bl -tag -width Ar .It Ar module_name Specifies the name of the module to be unloaded. .El .Sh EXIT STATUS .Bl -tag -width Ds .It 0 Successful completion. .It >0 Failure. .El .Sh EXAMPLES .Sy Example 1 Unloading a module of ID .Em 123 .Bd -literal -offset indent # modunload -i 123 .Ed .Pp .Sy Example 2 Unloading a module with name .Em some_driver .Bd -literal -offset indent # modunload some_driver .Ed .Sh SEE ALSO .Xr attributes 7 , .Xr modinfo 8 , .Xr modload 8 , .Xr update_drv 8 .Sh NOTES The .Nm 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 .Xr update_drv 8 command.