use set_serial to switch to low latency mode on serial device

This commit is contained in:
john30
2017-05-28 15:59:47 +02:00
parent 4638ff5f17
commit fa4dca7aec
2 changed files with 8 additions and 2 deletions
Executable → Regular
+7 -1
View File
@@ -29,10 +29,16 @@ instance="EBUSD_OPTS$2"
instance=${!instance}
start_instance () {
local opts suffix
local opts suffix dev
opts=$1
shift
suffix="${opts#EBUSD_OPTS}"
dev=`echo " ${!opts}"|sed -e 's#^.* -d ##' -e 's# -.*$##'`
if [ -n "$dev" ] && [ "${dev:0:5}" == '/dev/' ] && [ -c "$dev" ] && [ -x /bin/setserial ]; then
log_daemon_msg "Setting low latency for ebusd${suffix} device"
/bin/setserial "$dev" low_latency
log_end_msg $?
fi
log_daemon_msg "Starting ebusd${suffix}" ebusd
pidfile=$PIDFILE_PREFIX${suffix}$PIDFILE_SUFFIX
start-stop-daemon --start --quiet --oknodo --pidfile $pidfile --exec $DAEMON -- --pidfile $pidfile ${!opts}