[svn-commits] tzafrir: tools/trunk r7997 - in /tools/trunk: dahdi.init init.conf.sample

SVN commits to the Digium repositories svn-commits at lists.digium.com
Sun Feb 7 03:13:56 CST 2010


Author: tzafrir
Date: Sun Feb  7 03:13:50 2010
New Revision: 7997

URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=7997
Log:
dahdi.init: allow specifying the module(s) to download.

At the 'stop' command, the dahdi init.d service unloads dahdi
(and any module it depends in).

With this change, the user will be able to specify the modules to
unload, by setting DAHDI_UNLOAD_MODULES in init.conf. This allows:

* Disabling module unloading altogether
* Allowing the user to unload other modules as well, e.g. the 'echo'
  module of OSLEC, if you build it as part of DAHDI.

Note that unless you explicitly set DAHDI_UNLOAD_MODULES, the script
behaves exatly as before.

Modified:
    tools/trunk/dahdi.init
    tools/trunk/init.conf.sample

Modified: tools/trunk/dahdi.init
URL: http://svnview.digium.com/svn/dahdi/tools/trunk/dahdi.init?view=diff&rev=7997&r1=7996&r2=7997
==============================================================================
--- tools/trunk/dahdi.init (original)
+++ tools/trunk/dahdi.init Sun Feb  7 03:13:50 2010
@@ -37,6 +37,10 @@
 # device nodes after the modules have loaded and before running dahdi_cfg.
 DAHDI_DEV_TIMEOUT=20
 
+# A list of modules to unload when stopping.
+# All of their dependencies will be unloaded as well.
+DAHDI_UNLOAD_MODULES="dahdi"
+
 #
 # Determine which kind of configuration we're using
 #
@@ -97,6 +101,12 @@
 		(unload_module $mod)
 	done
 	rmmod $module
+}
+
+unload_modules() {
+	for module in $DAHDI_UNLOAD_MODULES; do
+		unload_module $module
+	done
 }
 
 # In (xpp) hotplug mode, the init script is also executed from the
@@ -275,7 +285,7 @@
 	# Unload drivers
 	#shutdown_dynamic # FIXME: needs test from someone with dynamic spans
 	echo -n "Unloading DAHDI hardware modules: "
-	if unload_module dahdi; then
+	if unload_modules; then
 		echo "done"
 	else
 		echo "error"
@@ -285,7 +295,7 @@
 	fi
 	;;
   unload)
-	unload_module dahdi
+	unload_modules
 	;;
   restart|force-reload)
 	$0 stop

Modified: tools/trunk/init.conf.sample
URL: http://svnview.digium.com/svn/dahdi/tools/trunk/init.conf.sample?view=diff&rev=7997&r1=7996&r2=7997
==============================================================================
--- tools/trunk/init.conf.sample (original)
+++ tools/trunk/init.conf.sample Sun Feb  7 03:13:50 2010
@@ -8,6 +8,11 @@
 # device nodes after the modules have loaded and before running dahdi_cfg. 
 #DAHDI_DEV_TIMEOUT=40
 
+# A list of modules to unload when stopping.
+# All of their dependencies will be unloaded as well.
+#DAHDI_UNLOAD_MODULES=""		# Disable module unloading
+#DAHDI_UNLOAD_MODULES="dahdi echo"	# If you use OSLEC
+
 # Override settings for xpp_fxloader
 #XPP_FIRMWARE_DIR=/usr/share/dahdi
 #XPP_HOTPLUG_DISABLED=yes




More information about the svn-commits mailing list