Add support for Fedora to mythtv-update-motd based on proposed file
from Göran Uddebor.
+ Switch from /var/run to /run.
+
2018-12-31 Andrew Ruthven
Ship a systemd service file which correctly starts and stops the motd
update services. As part of this change, if you use systemd or sysvinit
----
To update the message of the day you will probably want to modify
bin/mythtv-update-motd to work with the location of your /etc/motd
-file (on Debian it is symlinked into /var/run), and then run that
+file (on Debian it might be symlinked into /run), and then run that
script on a regular basis from cron.
exit
fi
-WORKFILE=/var/run/motd
-STUBFILE=/var/run/motd.orig
-TEMPFILE=/var/run/motd.mythtv-status
+WORKFILE=/run/motd
+STUBFILE=/run/motd.orig
+TEMPFILE=/run/motd.mythtv-status
if [ -d /etc/update-motd.d ]
then
# We want to generate file which only contains the MythTV Status
# as a snippet in /etc/update-motd.d will cat this file.
- WORKFILE=/var/run/motd.mythtv-status
+ WORKFILE=/run/motd.mythtv-status
TEMPFILE=${WORKFILE}.new
else
# We are going to generate an motd file to be used for the system,
if [ $DISTRO = 'debian' ]
then
# Debian Wheezy+ handles the MOTD differently.
- [ -f /var/run/motd.dynamic ] && WORKFILE=/var/run/motd.dynamic
+ [ -f /run/motd.dynamic ] && WORKFILE=/run/motd.dynamic
elif [ $DISTRO eq 'fedora' ]
then
WORKFILE=/etc/motd
* Ship a systemd service file (Closes: #772801)
* Rename RUN and ARGS in /etc/default/mythtv-status to be more
specific, since this file is used by a couple of different scripts.
+ * Switch from /var/run to /run.
-- Andrew Ruthven <andrew@etc.gen.nz> Mon, 31 Dec 2018 21:58:47 +1300
DAEMON=/usr/bin/mythtv-status # Introduce the server's location here
NAME=mythtv-status # Introduce the short server's name here
DESC="MythTV Status" # Introduce a short description here
-TEMPFILE=/var/run/motd.mythtv-status
-WORKFILE=/var/run/motd
+TEMPFILE=/run/motd.mythtv-status
+WORKFILE=/run/motd
DISABLED_FLAG=/var/lib/mythtv-status/motd_update_disabled
test -x $DAEMON || exit 0
fi
# Debian Wheezy+ handles the MOTD differently.
-[ -f /var/run/motd.dynamic ] && WORKFILE=/var/run/motd.dynamic
+[ -f /run/motd.dynamic ] && WORKFILE=/run/motd.dynamic
set -e
stop)
log_daemon_msg "Stopping $DESC" "$NAME"
touch $DISABLED_FLAG
- [ -f /var/run/motd.orig ] && cp /var/run/motd.orig $WORKFILE
- rm /var/run/motd.orig 2> /dev/null || true
+ [ -f /run/motd.orig ] && cp /run/motd.orig $WORKFILE
+ rm /run/motd.orig 2> /dev/null || true
rm $TEMPFILE 2> /dev/null || true
log_end_msg 0
;;
case "$1" in
purge|remove|failed-upgrade|abort-install|abort-upgrade|disappear)
- if [ -f /var/run/motd.orig ]
+ if [ -f /run/motd.orig ]
then
- mv /var/run/motd.orig /var/run/motd
+ mv /run/motd.orig /run/motd
fi
if [ "$1" = "purge" ]; then
# See:
# man mythtv-update-motd
# on how to disable this service if you don't want it to run.
-[ -f /var/run/motd.mythtv-status ] && cat /var/run/motd.mythtv-status
+[ -f /run/motd.mythtv-status ] && cat /run/motd.mythtv-status