Added some distribution specific files (start scripts, config files
etc) for Ubuntu. git-svn-id: svn://svn.code.sf.net/p/svxlink/svn/trunk@1432 f8843c6b-282e-0410-804b-c0d5895947d2
This commit is contained in:
parent
c7fe24e50f
commit
43cf3ae24a
|
|
@ -0,0 +1,21 @@
|
|||
#############################################################################
|
||||
#
|
||||
# Configuration file for the RemoteTrx startup script /etc/init.d/remotetrx
|
||||
#
|
||||
#############################################################################
|
||||
|
||||
# The log file to use
|
||||
LOGFILE=/var/log/remotetrx
|
||||
|
||||
# The PID file to use
|
||||
PIDFILE=/var/run/remotetrx.pid
|
||||
|
||||
# The user to run the SvxLink server as
|
||||
RUNASUSER=svxlink
|
||||
|
||||
# Specify which configuration file to use
|
||||
CFGFILE=/etc/remotetrx.conf
|
||||
|
||||
# Environment variables to set up. Separate variables with a space.
|
||||
ENV="ASYNC_AUDIO_NOTRIGGER=1"
|
||||
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
#############################################################################
|
||||
#
|
||||
# Configuration file for the SvxLink startup script /etc/init.d/svxlink
|
||||
#
|
||||
#############################################################################
|
||||
|
||||
# The log file to use
|
||||
LOGFILE=/var/log/svxlink
|
||||
|
||||
# The PID file to use
|
||||
PIDFILE=/var/run/svxlink.pid
|
||||
|
||||
# The user to run the SvxLink server as
|
||||
RUNASUSER=svxlink
|
||||
|
||||
# Specify which configuration file to use
|
||||
CFGFILE=/etc/svxlink.conf
|
||||
|
||||
# Environment variables to set up. Separate variables with a space.
|
||||
ENV="ASYNC_AUDIO_NOTRIGGER=1"
|
||||
|
||||
|
|
@ -0,0 +1,80 @@
|
|||
#!/bin/sh
|
||||
|
||||
### BEGIN INIT INFO
|
||||
# Provides: remotetrx
|
||||
# Required-Start: $network $local_fs $remote_fs $syslog
|
||||
# Required-Stop:
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 0 1 6
|
||||
# Short-Description: Start RemoteTrx Server daemon
|
||||
### END INIT INFO
|
||||
|
||||
# Use the following command to activate the start script
|
||||
# update-rc.d remotetrx start 30 2 3 4 5 . stop 70 0 1 6 .
|
||||
|
||||
PATH=/sbin:/bin:/usr/sbin:/usr/bin
|
||||
|
||||
. /lib/lsb/init-functions
|
||||
|
||||
PNAME=remotetrx
|
||||
NAME="RemoteTrx Server"
|
||||
DAEMON=/usr/bin/$PNAME
|
||||
|
||||
test -x $DAEMON || exit 5
|
||||
|
||||
if [ -r /etc/default/$PNAME ]; then
|
||||
. /etc/default/$PNAME
|
||||
fi
|
||||
|
||||
POPTS="--daemon ${RUNASUSER:+--runasuser=$RUNASUSER} ${PIDFILE:+--pidfile=$PIDFILE} ${LOGFILE:+--logfile=$LOGFILE} ${CFGFILE:+--config=$CFGFILE}"
|
||||
|
||||
create_logfile()
|
||||
{
|
||||
touch $LOGFILE
|
||||
if [ -n "$RUNASUSER" ]; then
|
||||
chown $RUNASUSER.$RUNASUSER $LOGFILE
|
||||
fi
|
||||
}
|
||||
|
||||
case $1 in
|
||||
start)
|
||||
log_daemon_msg "Starting $NAME: $PNAME"
|
||||
create_logfile
|
||||
export $ENV
|
||||
start-stop-daemon --start --quiet --pidfile $PIDFILE --startas $DAEMON -- $POPTS
|
||||
log_end_msg $?
|
||||
;;
|
||||
stop)
|
||||
log_daemon_msg "Stopping $NAME: $PNAME"
|
||||
start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE
|
||||
log_end_msg $?
|
||||
rm -f $PIDFILE
|
||||
;;
|
||||
restart|force-reload)
|
||||
$0 stop && sleep 2 && $0 start
|
||||
;;
|
||||
try-restart)
|
||||
if $0 status >/dev/null; then
|
||||
$0 restart
|
||||
else
|
||||
exit 0
|
||||
fi
|
||||
;;
|
||||
reload)
|
||||
exit 3
|
||||
;;
|
||||
status)
|
||||
pidofproc -p $PIDFILE $DAEMON >/dev/null
|
||||
status=$?
|
||||
if [ $status -eq 0 ]; then
|
||||
log_success_msg "$NAME is running."
|
||||
else
|
||||
log_failure_msg "$NAME is not running."
|
||||
fi
|
||||
exit $status
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart|try-restart|force-reload|status}"
|
||||
exit 2
|
||||
;;
|
||||
esac
|
||||
|
|
@ -0,0 +1,80 @@
|
|||
#!/bin/sh
|
||||
|
||||
### BEGIN INIT INFO
|
||||
# Provides: svxlink
|
||||
# Required-Start: $network $local_fs $syslog $ntp
|
||||
# Required-Stop:
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 0 1 6
|
||||
# Short-Description: Start SvxLink Server daemon
|
||||
### END INIT INFO
|
||||
|
||||
# Use the following command to activate the start script
|
||||
# update-rc.d svxlink start 30 2 3 4 5 . stop 70 0 1 6 .
|
||||
|
||||
PATH=/sbin:/bin:/usr/sbin:/usr/bin
|
||||
|
||||
. /lib/lsb/init-functions
|
||||
|
||||
PNAME=svxlink
|
||||
NAME="SvxLink Server"
|
||||
DAEMON=/usr/bin/$PNAME
|
||||
|
||||
test -x $DAEMON || exit 5
|
||||
|
||||
if [ -r /etc/default/$PNAME ]; then
|
||||
. /etc/default/$PNAME
|
||||
fi
|
||||
|
||||
POPTS="--daemon ${RUNASUSER:+--runasuser=$RUNASUSER} ${PIDFILE:+--pidfile=$PIDFILE} ${LOGFILE:+--logfile=$LOGFILE} ${CFGFILE:+--config=$CFGFILE}"
|
||||
|
||||
create_logfile()
|
||||
{
|
||||
touch $LOGFILE
|
||||
if [ -n "$RUNASUSER" ]; then
|
||||
chown $RUNASUSER.$RUNASUSER $LOGFILE
|
||||
fi
|
||||
}
|
||||
|
||||
case $1 in
|
||||
start)
|
||||
log_daemon_msg "Starting $NAME: $PNAME"
|
||||
create_logfile
|
||||
export $ENV
|
||||
start-stop-daemon --start --quiet --pidfile $PIDFILE --startas $DAEMON -- $POPTS
|
||||
log_end_msg $?
|
||||
;;
|
||||
stop)
|
||||
log_daemon_msg "Stopping $NAME: $PNAME"
|
||||
start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE
|
||||
log_end_msg $?
|
||||
rm -f $PIDFILE
|
||||
;;
|
||||
restart|force-reload)
|
||||
$0 stop && sleep 2 && $0 start
|
||||
;;
|
||||
try-restart)
|
||||
if $0 status >/dev/null; then
|
||||
$0 restart
|
||||
else
|
||||
exit 0
|
||||
fi
|
||||
;;
|
||||
reload)
|
||||
exit 3
|
||||
;;
|
||||
status)
|
||||
pidofproc -p $PIDFILE $DAEMON >/dev/null
|
||||
status=$?
|
||||
if [ $status -eq 0 ]; then
|
||||
log_success_msg "$NAME is running."
|
||||
else
|
||||
log_failure_msg "$NAME is not running."
|
||||
fi
|
||||
exit $status
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart|try-restart|force-reload|status}"
|
||||
exit 2
|
||||
;;
|
||||
esac
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
/var/log/svxlink /var/log/remotetrx {
|
||||
missingok
|
||||
notifempty
|
||||
weekly
|
||||
create 0644 svxlink daemon
|
||||
postrotate
|
||||
killall -HUP svxlink
|
||||
killall -HUP remotetrx
|
||||
endscript
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
# Set full access on serial and audio devices so that SvxLink can
|
||||
# access them without problem.
|
||||
KERNEL=="tty[A-Z]*", MODE:="0666"
|
||||
KERNEL=="dsp*", MODE:="0666"
|
||||
Loading…
Reference in New Issue