Moxa V2416-T-LX [53/88] Logging the hot swapping daemon message

Moxa V2416-W7E [53/88] Logging the hot swapping daemon message
V2416 Linux User's Manual Managing Communications
3-29
ATTENTION
Be sure to press the button before removing the disks. The LEDs will blink 3 times to indicate that the disks
have been successfully unmounted from the system, and that you can remove the disks from the computer.
Logging the Hot-swapping Daemon Message
The section describes how to log the mxhtspd message with the rsyslogd daemon. Use the following steps:
1. Check your run level in the /etc/inittab file; the default is 2.
# The default runlevel.
id:2:initdefault:
2. Enable rsyslogd at startup.
Moxa:/etc/rc2.d# mv N10rsyslog S10rsyslog
3. Add -l 0 options in the /etc/init.d/mxhtspd.sh script to enable the mxhtspd logging function with local
0.
#Add parameter if necessary
mxhtspd -l 0&
4. Edit the configuration file /etc/rsysload.conf.
#Uncomment below lines for mxhtspd with local 0
local0.* -/var/log/mxhtspd.log
mxhtspd will use the local0 facility to log a message. The destination file is /var/log/mxhtspd.log. The
minus (-) sign indicates to omit syncing the file after every logging.
5. Restart your computer to activate the settings.
ATTENTION
When you run rsyslogd daemon to log messages at startup, take care to prevent excessive disk usage.
An Example for Deploying mxhtspd Daemon
In this section we use a real example to illustrate how to deploy mxhtspd. The program is named
log_application and its major task is to collect important data and save the data to the disk drive daily. The
following settings will illustrate how to identify that the saved disk is full, and how to start or stop the
application without using an external monitor.
1. Start the daemon when button 1 is pressed longer than 5 seconds. Add the following lines in the
action_btn_long_pressed file to trigger your program.
#!/bin/sh
file=`basename $0`
num=$1
#Add your commands here
/home/log_application
echo $file: Button $num is long pressed

Содержание

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

Скачать