Trusted Solaris Administrator's Procedures

Writing New Device-Clean Scripts

Devices that can be made allocatable include modems, terminals, and graphics tablets. The task of making any of these devices allocatable includes writing a new device-clean script. Device-clean scripts should also be created for any added tape devices, except for Xylogics or Archive tape drives, which can use the default device_clean(1M) script (/etc/security/lib/st_clean).

The default location for device-clean scripts is /etc/security/lib.

Device-clean scripts must return 0 for success and greater than 0 for failure.

Failure or inability to forcibly eject the medium must put the device in the allocate error state.

The deallocate(1) command passes four parameters to the device-clean scripts as shown here:


device_clean -[I|F|S] -[A|D] device_name label

The option letters -I|-F|-S help the script determine its running mode. -I is needed during system boot only. All output must go to the system console. -F is for forced clean up and -S is for standard cleanup. These are interactive and assume that the user is there to respond to prompts. With the -F option, the script must attempt to complete the cleanup if one part of the cleanup fails.

[-[A]-[D]] indicates whether the clean script is called from allocate(1) or deallocate.

The device_name field is a string with the name of the device.

The label field is a hexadecimal representation of the label.