Check is Snail daemon is running.
This commit is contained in:
parent
82b80f6038
commit
8ebb0c6f90
|
@ -7,6 +7,8 @@ TIMEOUT=8 # wait timeout for X server start
|
|||
LOCK_FILE=/tmp/.snail.lock
|
||||
FIFO_FILE=/tmp/.snail.fifo
|
||||
|
||||
[ ! -f $LOCK_FILE ] && echo "Snail daemon is not running. Please start." && exit -1
|
||||
|
||||
{
|
||||
flock -w 0 -s 9
|
||||
if [ 0 -ne $? ]; then
|
||||
|
|
|
@ -20,6 +20,15 @@ FIFO_FILE=/tmp/.snail.fifo
|
|||
|
||||
$XSERVER_STOP_CMD && snail.nv_pwr_off # stop X service
|
||||
|
||||
sigterm ()
|
||||
{
|
||||
rm -f $LOCK_FILE
|
||||
rm -f $FIFO_FILE
|
||||
exit 0
|
||||
}
|
||||
|
||||
trap sigterm SIGTERM
|
||||
|
||||
touch $LOCK_FILE && chown root:video $LOCK_FILE && chmod 660 $LOCK_FILE # create lock file
|
||||
rm -f $FIFO_FILE && mkfifo --mode 660 $FIFO_FILE && chgrp video $FIFO_FILE # create fifo
|
||||
|
||||
|
|
Loading…
Reference in New Issue