[Pkg-voip-commits] [dahdi-tools] 100/285: Don't fail init script if no modules

tzafrir at debian.org tzafrir at debian.org
Thu Jul 7 19:18:38 UTC 2016


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

tzafrir pushed a commit to branch master
in repository dahdi-tools.

commit de23ca9c1a6055f187b16f059661691109a382c0
Author: Tzafrir Cohen <tzafrir.cohen at xorcom.com>
Date:   Thu May 23 19:49:57 2013 +0300

    Don't fail init script if no modules
    
    No point in loading the modules if nobody built them yet. It is a common
    case for one to install the userspace tools package but not (yet?) build
    the modules. See, e.g.  http://bugs.debian.org/706046 .
    
    With this changeset, we exit gracefully in such a case.
    
    Signed-off-by: Tzafrir Cohen <tzafrir.cohen at xorcom.com>
    Signed-off-by: Russ Meyerriecks <rmeyerriecks at digium.com>
---
 dahdi.init | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/dahdi.init b/dahdi.init
index 5fe3cec..c772a92 100755
--- a/dahdi.init
+++ b/dahdi.init
@@ -227,6 +227,11 @@ load_modules() {
 	echo ""
 }
 
+# Make sure that either dahdi is loaded or modprobe-able
+dahdi_modules_loadable() {
+	modinfo dahdi >/dev/null 2>&1 || lsmod | grep -q -w ^dahdi
+}
+
 if [ ! -x "$DAHDI_CFG" ]; then
        echo "dahdi_cfg not executable"
        exit 0
@@ -242,6 +247,10 @@ RETVAL=0
 # See how we were called.
 case "$1" in
   start)
+	if ! dahdi_modules_loadable; then
+		echo "No DAHDI modules on the system. Not starting"
+		exit 0
+	fi
   	if hotplug_should_load_modules; then
 		load_modules
 	fi

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-voip/dahdi-tools.git



More information about the Pkg-voip-commits mailing list