Ice Bear SoftUnmount Daemon for Fedora

Fedora automatically mounts removable media as CD/DVD, USB disks. I did not manage to suppress this microsoftism, therefore I have developed this simple daemon.

The daemon periodically scans for mounted devices. It ignores those the mount points of which are listed in /etc/fstab as well as those the device name of which does not start with a slash. Other devices are unmounted. The configuration file allows to set other devices that must not be unmounted by the daemon.

Before installation make sure that you have a bootable medium for starting a system in case of emergency and that t allows you to mount your hard disk with write permission (you must be root). If the system is locked when starting zwumountd, boot from that media and issue:

find /hd/mount/point/etc/rc.d -name S98zwumountd -delete

Use you real mount point in place of /hd/mount/point. It may be /mnt/sysimage.

The program can be installed by:

su -c 'make install'

It may be uninstalled by:

su -c 'make uninstall'

The program can be controlled by standard tools chkconfig and service.

Devices that must not be unmounted can be set up in /etc/zwumountd.conf:

    # Configuration file for zwumountd.pl
    # This must be a valid perl code.
    #
    # Time to sleep within a loop (seconds), do not set it too small
    # sleeptime = 10; # this is the default
    #
    # Now we define allowed devices, mount points and types. The daemon
    # will never unmount a file system if the mount point is listed
    # in /etc/fstab or if the device name does not start with a slash.
    # All arrays must be lists of regular expressions. They are empty
    # as default;
    # @allowdev = ('list');
    # @allowmtpoint = ('list');
    # @allowtype = ('list');
    #
    # Do not remove the last line.
    1;
  

USB disks are mounted on my notebook on /dev/sdb1, /dev/sdc1 etc. I want to keep this feature. I have therefore added the following rule to my configuration:

@allowdev = ('^\/dev\/sd[b-z]');

After changing /etc/fstab or /etc/zwumountd.conf the daemon must be restarted in order to read new information.

There are a few known bugs in the program:

  1. service zwumountd status reports that the program is stopped although the progrum runs.
  2. service zwumountd start does not display a prompt, it is necessary to press ENTER. The same applies to service zwumountd restart.

The program can be used and distributed under GPL.

Download: zwumountd.tar.bz2

I am forced to sponsor musicians and other copyright organisations by my programming work because I store my software, input data as well as the results of calculation on CD and DVD media.