rmmount(1M)

NAME

rmmount– removable media mounter for CD-ROM and floppy

SYNOPSIS

/usr/sbin/rmmount [-D]

DESCRIPTION

The rmmount utility is a removable media mounter that is executed by Volume Management whenever a CD-ROM or floppy is inserted. The Volume Management daemon, vold(1M), manages CD-ROM and floppy devices. rmmount is also called by volrmmount(1), and by device allocation clean scripts invoked by
the allocate(1) command.

If the media is read-only (either CD-ROM or floppy with write-protect tab set), the file system is mounted read-only.

If a file system type has been determined, it is then checked to see that it is “clean.” If the file system is “dirty,” fsck -p (see fsck(1M)) is run in an attempt to clean it. If fsck fails, the file system is mounted read-only.

After the mount is complete, “actions” associated with the media type are executed. These actions allow for the notification to other programs that new media are available. These actions are shared objects and are described in the configuration file, /etc/rmmount.conf.

Actions are executed in the order in which they appear in the configuration file. The action function can return either 1 or 0. If it returns 0, no further actions will be executed. This allows the function to control which applications are
executed.

In order to execute an action, rmmount performs a dlopen(3DL) on the shared object and calls the action function defined within it. The
definition of the interface to actions can be found in /usr/include/rmmount.h. The actions are run in the rmmount process, that is, at label ADMIN_LOW, with a UID of 0, and with the privileges
of rmmount (see SUMMARY OF TRUSTED SOLARIS CHANGES). If an action does not require privileges, it should fork a child process to do the work of the action, and the child process whould change its effective UID. For example, if the action should run as the user logged in on the console, the process UID should
be set to the UID of /dev/console.

File systems mounted by rmmount are always mounted with the nosuid flag set, thereby disabling set-uid programs and access to block or character devices in that file system. Upon ejection, rmmount unmounts mounted file systems and executes
actions associated with the media type. If a file system is “busy” (that is, it contains the current working directory of a live process), the ejection will fail.

OPTIONS

-D

Turn on the debugging output from the rmmount dprintf calls.

ENVIRONMENT VARIABLES

Several environment variables must be passed to rmmount.

VOLUME_ACTION

The event type to be handled. The event types are insert, remount, clear_mounts, eject, and unmount.

VOLUME_MEDIATYPE

The type of media be mounted or unmounted, for example, cdrom or floppy

VOLUME_NAME

A name for the mounted media. This is typically the volume name taken from the media's label.

VOLUME_PATH

Pathname of the device special file for the device on which the filesystem resides.

VOLUME_SYMDEV

Symbolic name of the device containing the volume, for example, cdrom0 or floppy0.

Two other environment variables may optionally be passed to rmmount.

VOLUME_PCFS_ID

Partition letter for a PCFS file system.

VOLUME_MOUNT_MODE

Mount mode. If not supplied, the default mode is “r” for read-only file systems, and “rw” for others.

The rmmount command mounts the media on device $VOLUME_PATH at the mount point /$VOLUME_MEDIATYPE/$VOLUME_NAME. It also creates a symbolic link $VOLUME_MEDIATYPE/$VOLUME_SYMDEV pointing to the /$VOLUME_MEDIATYPE/$VOLUME_NAME mount point.

With the values of the environment variables passed by vold(1M), the file system is mounted in one of the following locations: