1
From: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2
Date: Sun, 7 Feb 2010 09:13:50 +0000
3
Subject: dahdi.init: allow specifying the module(s) to download.
4
Origin: http://svn.digium.com/svn/dahdi/tools/trunk@7997
6
At the 'stop' command, the dahdi init.d service unloads dahdi
7
(and any module it depends in).
9
With this change, the user will be able to specify the modules to
10
unload, by setting DAHDI_UNLOAD_MODULES in init.conf. This allows:
12
* Disabling module unloading altogether
13
* Allowing the user to unload other modules as well, e.g. the 'echo'
14
module of OSLEC, if you build it as part of DAHDI.
16
Note that unless you explicitly set DAHDI_UNLOAD_MODULES, the script
17
behaves exatly as before.
19
This patch is included in current trunk of dahdi-tools (will become 2.3).
22
dahdi.init | 14 ++++++++++++--
23
init.conf.sample | 5 +++++
24
2 files changed, 17 insertions(+), 2 deletions(-)
26
diff --git a/dahdi.init b/dahdi.init
27
index cbc9dc7..91ae44e 100755
30
@@ -37,6 +37,10 @@ XPP_SYNC=auto
31
# device nodes after the modules have loaded and before running dahdi_cfg.
34
+# A list of modules to unload when stopping.
35
+# All of their dependencies will be unloaded as well.
36
+DAHDI_UNLOAD_MODULES="dahdi"
39
# Determine which kind of configuration we're using
41
@@ -99,6 +103,12 @@ unload_module() {
46
+ for module in $DAHDI_UNLOAD_MODULES; do
47
+ unload_module $module
51
# In (xpp) hotplug mode, the init script is also executed from the
52
# hotplug hook. In that case it should not attempt to loade modules.
54
@@ -275,7 +285,7 @@ case "$1" in
56
#shutdown_dynamic # FIXME: needs test from someone with dynamic spans
57
echo -n "Unloading DAHDI hardware modules: "
58
- if unload_module dahdi; then
59
+ if unload_modules; then
63
@@ -285,7 +295,7 @@ case "$1" in
72
diff --git a/init.conf.sample b/init.conf.sample
73
index 9fb6393..58edec5 100644
74
--- a/init.conf.sample
75
+++ b/init.conf.sample
77
# device nodes after the modules have loaded and before running dahdi_cfg.
80
+# A list of modules to unload when stopping.
81
+# All of their dependencies will be unloaded as well.
82
+#DAHDI_UNLOAD_MODULES="" # Disable module unloading
83
+#DAHDI_UNLOAD_MODULES="dahdi echo" # If you use OSLEC
85
# Override settings for xpp_fxloader
86
#XPP_FIRMWARE_DIR=/usr/share/dahdi
87
#XPP_HOTPLUG_DISABLED=yes