[vdr] 09/12: Let systemd service create reccmds.conf/commands.conf when starting vdr

Tobias Grimm tiber-guest at moszumanska.debian.org
Sun Aug 30 16:17:40 UTC 2015


This is an automated email from the git hooks/post-receive script.

tiber-guest pushed a commit to branch e-tobi
in repository vdr.

commit 24d1532240f845196bee491d425c0fecc177a97a
Author: etobi <git at e-tobi.net>
Date:   Sun Aug 30 10:09:34 2015 +0200

    Let systemd service create reccmds.conf/commands.conf when starting vdr
---
 debian/{commands-loader.sh => merge-commands.sh} | 23 ++++++++++-------------
 debian/vdr.init                                  |  7 ++-----
 debian/vdr.install                               |  2 +-
 debian/vdr.service                               |  2 ++
 4 files changed, 15 insertions(+), 19 deletions(-)

diff --git a/debian/commands-loader.sh b/debian/merge-commands.sh
similarity index 54%
rename from debian/commands-loader.sh
rename to debian/merge-commands.sh
index 0092f34..2746b3d 100644
--- a/debian/commands-loader.sh
+++ b/debian/merge-commands.sh
@@ -1,7 +1,12 @@
 #
-# This file is called by /etc/init.d/vdr
+# This file is called by /etc/init.d/vdr and the by vdr.service
+#
+# merges single <cmdtype>.<name>.conf files into one <cmdtype>.conf
+# in alphabetical order
 #
 
+. /usr/lib/vdr/config-loader.sh
+
 writewarning ()
 {
 echo -e \
@@ -12,17 +17,9 @@ echo -e \
 "#\n\n\n"
 }
 
-# merges single <cmdtype>.<name>.conf files into one <cmdtype>.conf
-# in alphabetical order
-mergecommands ()
-{
-    local cmdtype
-    local cmdfile
+cmdtype=$1
+cmdfile="/var/cache/vdr/$cmdtype.conf"
 
-    cmdtype=$1
-    cmdfile="/var/cache/vdr/$cmdtype.conf"
+writewarning $cmdtype > "$cmdfile"
 
-    writewarning $cmdtype > "$cmdfile"
-
-    find $CMDHOOKSDIR -maxdepth 1 -name "$cmdtype.*.conf" | sort | xargs cat >> "$cmdfile"
-}
+find $CMDHOOKSDIR -maxdepth 1 -name "$cmdtype.*.conf" | sort | xargs cat >> "$cmdfile"
diff --git a/debian/vdr.init b/debian/vdr.init
index c80a327..23ab724 100644
--- a/debian/vdr.init
+++ b/debian/vdr.init
@@ -27,9 +27,6 @@ test -x $VDRPRG || exit 0
 
 . /usr/lib/vdr/config-loader.sh
 
-. /usr/lib/vdr/commands-loader.sh
-
-
 clean_console()
 {
     if [ "$KEYB_TTY" != "" ]; then
@@ -69,8 +66,8 @@ startvdr()
     if start-stop-daemon --start --startas $DAEMON --test \
         --name $(basename $DAEMON) --pidfile $PIDFILE >/dev/null
     then
-        mergecommands "commands"
-        mergecommands "reccmds"
+        /bin/sh /usr/lib/vdr/merge-commands.sh "commands"
+        /bin/sh /usr/lib/vdr/merge-commands.sh "reccmds"
         configure_console_input
 
         start-stop-daemon --start --quiet --startas $DAEMON --background -d /tmp \
diff --git a/debian/vdr.install b/debian/vdr.install
index 25a6a4e..b581156 100644
--- a/debian/vdr.install
+++ b/debian/vdr.install
@@ -13,7 +13,7 @@ epg2html                                usr/lib/vdr/
 debian/runvdr                           usr/lib/vdr/
 
 debian/config-loader.sh                 usr/lib/vdr/
-debian/commands-loader.sh               usr/lib/vdr/
+debian/merge-commands.sh                usr/lib/vdr/
 debian/vdr-groups.sh                    usr/lib/vdr/
 debian/vdr-recordingaction              usr/lib/vdr/
 debian/vdr-shutdown                     usr/lib/vdr/
diff --git a/debian/vdr.service b/debian/vdr.service
index e088e80..8053d5d 100644
--- a/debian/vdr.service
+++ b/debian/vdr.service
@@ -3,6 +3,8 @@ Description=Video Disk Recorder
 
 [Service]
 Type=notify
+ExecStartPre=/bin/sh /usr/lib/vdr/merge-commands.sh "commands"
+ExecStartPre=/bin/sh /usr/lib/vdr/merge-commands.sh "recmds"
 ExecStart=/usr/bin/vdr
 Restart=on-failure
 RestartPreventExitStatus=0 2

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-vdr-dvb/vdr.git



More information about the pkg-vdr-dvb-changes mailing list