How the Kernel Unloading Exits Work

To let you control operating system and third-party processes,  lets you make calls to UNIX exits automatically when unloading the kernel extension.
capamsc141
To let you control operating system and third-party processes, 
Privileged Access Manager
lets you make calls to UNIX exits automatically when unloading the kernel extension.
When you run
SEOS_load -u
Privileged Access Manager
performs the following actions:
  1. Looks for programs in the following directory:
    ACInstallDir/exits/LOAD
  2. Selects all the programs that have file names of the following format:
    SEOS_unload_string.always
    where
    string
    can be any descriptive strings.
  3. Executes, in lexicographical order, each file it found in the directory
    ACInstallDir
    /exits/LOAD:
    SEOS_load_string.always -pre
    Each file is executed with the
    -pre
    parameter so that you can write your exits to detect the parameter and perform the actions required before the kernel is unloaded.
    Note:
    If the exit returns a nonzero value, 
    Privileged Access Manager
    kills the exit process, displays an error message, and aborts the kernel unloading.
  4. Tries to unload the kernel, if the kernel
    does not
    unload: Selects all the programs that have file names of the following format:
    SEOS_unload_string.opt
    Executes, in lexicographical order, each file it found in the directory ACInstallDir/exits/LOAD:
    SEOS_unload_string.opt -pre
    Each file is executed with the -pre parameter so that you can write your conditional exits to detect the parameter and perform the additional optional actions required before the kernel is unloaded.
    Note:
    If the exit returns a nonzero value, then the product kills the exit process, displays an error message, and aborts the kernel unloading, unloads the kernel. Executes, in lexicographical order, each file it found in the directory ACInstallDir/exits/LOAD:
    SEOS_unload_string.opt -post
    Each file is executed with the -post parameter so that you can write your conditional exits to detect the parameter and perform the additional optional actions required before the kernel is unloaded.
    Note:
    If the exit returns a nonzero value, then the product kills the exit process and displays an error message. Having already been unloaded, the product kernel remains unloaded.
    SEOS_unload_string.opt
    Executes, in lexicographical order, each file it found in the directory ACInstallDir/exits/LOAD:
    SEOS_unload_string.always -post
    Each file is executed with the
    -post
    parameter so that you can write your exits to detect the parameter and perform the actions required after the kernel is loaded.
    Note:
    If the exit returns a nonzero value, the product kills the exit process and displays an error message. Having already been unloaded, the product kernel remains not loaded.