Moxa V2616A-C8-CT-W7E [66/111] Logging the hot swap daemon message

Moxa V2616A-C5-CT-W7E [66/111] Logging the hot swap daemon message
V2616A Linux Hot-swap Function
6-4
Logging the Hot-swap Daemon Message
The section describes how to log the mxhtspd message with the rsyslogd daemon. Use the following steps:
Check your run level in the /etc/inittab file; the default is 2.
# The default runlevel.
id:2:initdefault:
Enable rsyslogd at startup.
Moxa:/etc/rc2.d# mv N10rsyslog S10rsyslog
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&
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.
Restart your computer to activate the settings.
ATTENTION
When you run rsyslogd daemon to log message
s 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.
Start or stop the daemon when button X1 is pressed longer than 5 seconds. Add the following lines in the
action-btn-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

Содержание

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

Скачать