From: Andrew Ruthven Date: Fri, 11 Jan 2019 11:14:56 +0000 (+1300) Subject: Switch to /run X-Git-Tag: 1.0.0~12 X-Git-Url: http://git.etc.gen.nz/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e8051aad1e46ef45e7ed887e7a9863ad728cd3db;p=mythtv-status.git Switch to /run --- diff --git a/ChangeLog b/ChangeLog index 6da429a..055ff8f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,8 @@ 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 diff --git a/INSTALL b/INSTALL index cd8c846..ad697e4 100644 --- a/INSTALL +++ b/INSTALL @@ -31,6 +31,6 @@ MOTD ---- 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. diff --git a/bin/mythtv-update-motd b/bin/mythtv-update-motd index b5110f5..ac2df18 100755 --- a/bin/mythtv-update-motd +++ b/bin/mythtv-update-motd @@ -20,16 +20,16 @@ then 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, @@ -45,7 +45,7 @@ else 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 diff --git a/debian/changelog b/debian/changelog index 44747b7..e0c345f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -6,6 +6,7 @@ mythtv-status (1.0.0-1) UNRELEASED; urgency=medium * 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 Mon, 31 Dec 2018 21:58:47 +1300 diff --git a/debian/init.d b/debian/init.d index 28300ee..aee2760 100644 --- a/debian/init.d +++ b/debian/init.d @@ -35,8 +35,8 @@ PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin 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 @@ -57,7 +57,7 @@ if [ "x$UPDATE_MOTD" != "xyes" ] ; then 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 @@ -77,8 +77,8 @@ case "$1" in 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 ;; diff --git a/debian/postrm b/debian/postrm index 6ab8f7b..141883e 100644 --- a/debian/postrm +++ b/debian/postrm @@ -21,9 +21,9 @@ set -e 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 diff --git a/update-motd.d/50-mythtv-status b/update-motd.d/50-mythtv-status index b59ba9a..e24c0b6 100755 --- a/update-motd.d/50-mythtv-status +++ b/update-motd.d/50-mythtv-status @@ -2,4 +2,4 @@ # 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