Moxa V2416-T-LX [52/88] Handling an event with hot swapping daemon

Moxa V2416-T-LX [52/88] Handling an event with hot swapping daemon
V2416 Linux User's Manual Managing Communications
3-28
When more than 90% of either partition 1 of disk 2, or partition 1 of disk 1 is in use, the corresponding event
will be triggered.
Handling an Event with Hot-swapping Daemon
mxhtspd will be triggered when the following events occur:
1. A disk is plugged in
When a disk n with m partitions has been plugged in, the system will automatically mount its partitions on
/media/disknpm, where m ranges from 1 to m. For example, if disk 1 has two partitions, they would be
mounted on /media/disk1p1 and /media/disk1p2.
The action-disk-plugged script will be triggered with the disk number as argument. By default it will scan
the disk on the SATA bus. You can add some operations here when necessary.
Execute the mount command to check the disk mounting situation. The following example shows the status
of 2 disks with 2 partitions separately.
Moxa:~# mount
rootfs on / type rootfs (rw)
none on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
none on /proc type proc (rw,nosuid,nodev,noexec,relatime)
udev on /dev type tmpfs (rw,relatime,size=10240k,mode=755)
/dev/hda1 on / type ext2 (ro,relatime,errors=remount-ro)
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,relatime,mode=755)
usbfs on /proc/bus/usb type usbfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev,relatime)
devpts on /dev/pts type devpts
(rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
none on /tmp type tmpfs (rw,relatime)
/dev/hda2 on /home type ext2 (rw,relatime,errors=continue)
/dev/sda1 on /media/disk2p1 type ext3 (rw,relatime,errors=continue,data=ordered)
/dev/sda2 on /media/disk2p2 type ext3 (rw,relatime,errors=continue,data=ordered)
/dev/sdb1 on /media/disk1p1 type ext3 (rw,relatime,errors=continue,data=ordered)
/dev/sdb2 on /media/disk1p2 type ext3 (rw,relatime,errors=continue,data=ordered)
2. A button is pressed for less than 5 seconds (a short press)
When button n is pressed less than 5 seconds, which usually indicates a quick button press, the
action-btn-short-pressed script will be executed with argument n. It will umount all partitions on disk n
and the LED will blink 3 times at 1 second intervals to indicate that the disk has been successfully
unmounted, and that users can remove that hard disk from the storage tray.
3. A button is pressed longer than 5 seconds (a long press)
When the button n is pressed longer than 5 seconds, the action-btn-long-pressed script will be executed
with argument n. By default it does nothing and is able to add some user-defined operation. Note that the
long-pressed time can be set with the -t options.
4. A disk is unplugged
When disk n is unplugged, the action-disk-unplugged script will be triggered with argument n. It will
check if all partitions on disk n have been umounted before they were unplugged and warn the user if they
weren’t. The correct procedure is first press the button to umount the partitions and then unplug the disk.
The only purpose of this script is to warn of misuse or incorrect operation.
5. A monitored partition is over the specific usage limit, or does not exist
When /media/disknpm detects this situation, the daemon will show an error message and blink the warning
LED n at 1 second intervals. In addition, the action-part-over-usage script will be launched with argument
/media/disknpm.

Содержание

Похожие устройства

Скачать