Revert "Merge branch 'M17_AX25_FM'"

This reverts commit e1427e3e37, reversing
changes made to bcdba292eb.
This commit is contained in:
Jonathan Naylor
2020-12-15 15:52:27 +00:00
parent e1427e3e37
commit 135fd04e0d
115 changed files with 4808 additions and 9583 deletions

31
linux/systemd/README.md Normal file
View File

@@ -0,0 +1,31 @@
MMDVMHost Systemd setup
=======================
Preface
-------
Since moving to Systemd many admins are struggling with the differences, in an effort to take the work
out of installing MMDVMHost on your linux host, I have written a service handler and the related systemd
unit files.
I hope these help you get going quickly.
Written on / tested on / confirmed working on Raspbian Jessie-lite but should work just fine on any
system using systemd.
Enjoy, 73 de MW0MWZ
Install Instructions
--------------------
1. Copy mmdvmhost_service to /usr/local/sbin
2. Change the permisions of /usr/local/sbin/mmdvmhost_service to 500 (root executable)
3. Change the variables in /usr/local/sbin/mmdvmhost_service to match your setup
(MMDVMHost.ini location, log location, user and daemon location)
4. Copy mmdvmhost.service to /lib/systemd/system
5. Copy mmdvmhost.timer to /lib/systemd/system
6. Edit the timeout in mmdvmhost.timer to suit - 45 secs is a reasonable starting point.
7. Reload systemctl with: "systemctl daemon-reload"
8. Add the timer serice to the boot with: "systemctl enable mmdvmhost.timer"
**NOTE - There is no need / desire to enable mmdvmhost.service!

View File

@@ -1,12 +1,12 @@
[Unit]
Description=MMDVMHost Radio Service
Description=MMDVMHost Radio Servce
After=syslog.target network.target
[Service]
User=mmdvm
Type=forking
ExecStart=/usr/local/bin/MMDVMHost
Restart=on-abnormal
ExecStart=/usr/local/sbin/mmdvmhost_service start
ExecStop=/usr/local/sbin/mmdvmhost_service stop
ExecReload=/usr/local/sbin/mmdvmhost_service restart
[Install]
WantedBy=multi-user.target

View File

@@ -0,0 +1,5 @@
[Timer]
OnStartupSec=45
[Install]
WantedBy=multi-user.target

View File

@@ -0,0 +1,85 @@
#!/bin/bash
#########################################################
# #
# MMDVMHost Service Handler #
# #
# Written for Pi-Star (http://www.mw0mwz.co.uk/pi-star) #
# By Andy Taylor (MW0MWZ) #
# #
# Version 1.1 #
# #
#########################################################
# Service Config
DAEMON=MMDVMHost
DAEMON_PATH=/usr/local/bin/
CONFIG=/etc/mmdvmhost
DAEMON_OPTS=$CONFIG
PGREP=/usr/bin/pgrep
KILL=/bin/kill
SLEEP=/bin/sleep
USER=mmdvm
GROUP=mmdvm
LOGDIR=/var/log/pi-star
# Pre-flight checks...
test -x ${DAEMON_PATH}${DAEMON} || exit 1
test -r $CONFIG || exit 1
# Verify the logging directory exists, if not create it and setup the ownership / permissions
if [ ! -d $LOGDIR ]; then
mkdir -p $LOGDIR
chown root:$GROUP $LOGDIR
chmod 775 $LOGDIR
fi
case "$1" in
start)
if [ `${PGREP} ${DAEMON}` ]; then
echo -e "$DAEMON is already running as PID "`$PGREP $DAEMON`
exit 1;
else
runuser -l $USER -c "${DAEMON_PATH}${DAEMON} ${DAEMON_OPTS}"
echo -e "$DAEMON started as PID "`$PGREP $DAEMON`
exit 0;
fi
;;
stop)
if [ `${PGREP} ${DAEMON}` ]; then
echo -e "Killing $DAEMON PID "`$PGREP $DAEMON`
$KILL `${PGREP} ${DAEMON}`
exit 0;
else
echo -e "$DAEMON is not running"
exit 1;
fi
;;
restart)
if [ `$PGREP $DAEMON` ]; then
echo -e "Killing $DAEMON PID "`$PGREP $DAEMON`
$KILL `${PGREP} ${DAEMON}`
$SLEEP 3
runuser -l $USER -c "${DAEMON_PATH}${DAEMON} ${DAEMON_OPTS}"
echo -e "$DAEMON re-started as PID "`${PGREP} ${DAEMON}`
exit 0;
else
echo -e "$DAEMON is not running"
${DAEMON_PATH}${DAEMON} ${DAEMON_OPTS}
echo -e "$DAEMON started as PID "`${PGREP} ${DAEMON}`
exit 0;
fi
;;
status)
if [ `${PGREP} ${DAEMON}` ]; then
echo -e "$DAEMON is running as PID "`${PGREP} ${DAEMON}`
else
echo -e "$DAEMON is not running"
fi
;;
*)
echo $"Usage: $0 {start|stop|restart|status}"
exit 1
esac