[Pkg-voip-commits] r2234 - asterisk/trunk/debian

Diego Iastrubni elcuco-guest at costa.debian.org
Mon Aug 14 05:32:28 UTC 2006


Author: elcuco-guest
Date: 2006-08-14 05:32:26 +0000 (Mon, 14 Aug 2006)
New Revision: 2234

Modified:
   asterisk/trunk/debian/asterisk_fix
   asterisk/trunk/debian/changelog
   asterisk/trunk/debian/rules
Log:
merged some of the modifications to asterisk_fix
install this script as part of the main asterisk

all modifications are part of the 1:1.2.10.dfsg-3 release



Modified: asterisk/trunk/debian/asterisk_fix
===================================================================
--- asterisk/trunk/debian/asterisk_fix	2006-08-12 17:08:57 UTC (rev 2233)
+++ asterisk/trunk/debian/asterisk_fix	2006-08-14 05:32:26 UTC (rev 2234)
@@ -1,4 +1,4 @@
-#! /bin/sh -x
+#! /bin/sh
 
 if getent passwd asterisk >/dev/null ;then
 	# Some halfbaked Sarge versions needed their home dir fixed:
@@ -7,8 +7,14 @@
 		usermod -d /var/lib/asterisk asterisk
         fi
 else
-        adduser --system --group --home /var/lib/asterisk \
-		--gecos "Asterisk PBX daemon" asterisk
+	adduser-extra-opts=""
+	# Cosmetic noise reduction
+	if [ -d "/var/lib/asterisk" ]; then
+    		adduser-extra-opts="--no-create-home"
+	fi
+	adduser --system --group --home /var/lib/asterisk \
+	    $adduser-extra-opts \
+        	--gecos "Asterisk PBX daemon" asterisk		
 fi
 
 for group in dialout audio; do
@@ -17,37 +23,57 @@
 	fi
 done
 
-test -d /var/log/asterisk || mkdir -p /var/log/asterisk
-test -d /var/lib/asterisk || mkdir -p /var/lib/asterisk
-test -d /etc/asterisk || mkdir -p /etc/asterisk
-test -d /var/spool/asterisk/ || mkdir -p /var/spool/asterisk/
-chown -R asterisk.asterisk \
-        /var/log/asterisk \
-        /var/run/asterisk \
-        /var/spool/asterisk \
-        /var/lib/asterisk \
+# Make sure all (possibly) used dirs exist and is owned by asterisk
+# (/var/run/asterisk is handled in sysV script /etc/init.d/asterisk)
+dirs="
+        /var/log/asterisk
+        /var/spool/asterisk
+        /var/lib/asterisk
         /etc/asterisk
+"
 
+subdirs="
+        /var/log/asterisk/cdr-csv
+        /var/log/asterisk/cdr-custom
+        /var/spool/asterisk/dictate
+        /var/spool/asterisk/meetme
+        /var/spool/asterisk/monitor
+        /var/spool/asterisk/monitor
+        /var/spool/asterisk/system
+        /var/spool/asterisk/tmp
+        /var/spool/asterisk/voicemail
+"
+
+for dir in $subdirs $dirs; do
+        mkdir -p "$dir"
+done
+
+for dir in $dirs; do
+        chown -R asterisk: "$dir"
+done
+
+
+###################################
+# this part should be reviewed, but it's basically trial and error
+# code i wrote to make freepbx work. better solutions are welcomed.
+
 # files need to be RW by the group
 # dirs need to a+rx
-#chmod -R 0664 /etc/asterisk/
-#find /etc/asterisk/ -type d | xargs chmod a+rx
-#chmod +t /etc/asterisk/
+chmod -R 0660 /etc/asterisk/
+find /etc/asterisk/ -type d | xargs chmod ug+rx
 
+#chmod g+s /etc/asterisk/
+
 # this is needed because othewise sqlite cannot write to the DB
 #chmod -R 0660 /var/lib/asterisk/
 
 ####################################
-# TODO:
-#
-# the real setup should be :
-#   if asterisk is not running - start it (restart can deal with that)
-#   otherwise reload. 
-#   reload may fail, but start should not (it will be run on fist install only)
-#
-# Some changes are not fixed by a reload: e.g: adding/removing modules.
-# However a restart disconnects all calls in the pbx
-#
-# for simplicity, we just restart it by force right now.
-# may fail if the package asterisk is not yet configured.
-invoke-rc.d asterisk restart || true 
+# If asterisk in running, reload it
+# otherwise start it
+if [ -f "/etc/init.d/asterisk" ];then
+	if [ -f /var/run/asterisk/asterisk.pid ];then
+	    invoke-rc.d asterisk reload || exit $?
+	else
+	    invoke-rc.d asterisk start || exit $?
+	fi
+fi

Modified: asterisk/trunk/debian/changelog
===================================================================
--- asterisk/trunk/debian/changelog	2006-08-12 17:08:57 UTC (rev 2233)
+++ asterisk/trunk/debian/changelog	2006-08-14 05:32:26 UTC (rev 2234)
@@ -2,6 +2,8 @@
 
   * NOT  YET RELEASED
   * Add iaxy.bin to asterisk debs to have working IAX support.
+  * asterisk_fix is included on the main asterisk package (should fix #287025, #360233, #381861)
+  * Various fixes to asterisk_fix
 
  -- Kilian Krause <kilian at debian.org>  Thu,  3 Aug 2006 16:40:53 +0200
 

Modified: asterisk/trunk/debian/rules
===================================================================
--- asterisk/trunk/debian/rules	2006-08-12 17:08:57 UTC (rev 2233)
+++ asterisk/trunk/debian/rules	2006-08-14 05:32:26 UTC (rev 2234)
@@ -159,6 +159,10 @@
 	# in the sample configs:
 	cp -a debian/ast_config/* $(CURDIR)/debian/tmp/etc/asterisk
 	
+	mkdir -p $(CURDIR)/debian/asterisk/usr/share/asterisk/bin
+	cp debian/asterisk_fix $(CURDIR)/debian/asterisk/usr/share/asterisk/bin
+	chmod +x $(CURDIR)/debian/asterisk/usr/share/asterisk/bin/asterisk_fix
+	
 	mkdir -p $(CURDIR)/debian/tmp/usr/share/asterisk/firmware/iax
 	cp contrib/firmware/iax/*.bin $(CURDIR)/debian/tmp/usr/share/asterisk/firmware/iax
 	




More information about the Pkg-voip-commits mailing list