asterisk dapper.2114_to_dapper.2234 diff
Mark Purcell
msp at debian.org
Tue Aug 1 15:39:37 UTC 2006
On Friday 28 July 2006 22:23, Thiago Martins wrote:
> I'm working to make asterisk package a little bit more stable on Ubuntu
> Dapper Drake.
Hi Thiago,
I have been trying to catch up with the list and the work you have been doing.
I'm not entirely sure of your motivation on trying to get a set of changes to
the dapper asterisk packages in pkg-voip.
I suspect some of the issues you are having are related to the core asterisk
package we maintain in pkg-voip and some of the issues are related to the
ubuntu infrastructure.
The bulk of us here on pkg-voip are focused on delivery of the Debian
packages, but we are also supportive of the pullthrough of any relevant
patches into alioth which are of use, even if they come from an unbuntu
environment.
You said at one stage that you were using dapper as sarge wasn't current
enough for you, however sid has pretty much the same amount of stability as
sid or etch, so why don't you use those?
Having a look through your patch, I am happy to commit some to alioth, but
could you explain some elements to me:
--- asterisk-1.2.10.dfsg/debian/changelog 2006-07-28 16:51:35.000000000 -0300
+++ asterisk-1.2.10.dfsg.new/debian/changelog 2006-07-28
16:53:38.000000000 -0300
@@ -1,3 +1,14 @@
+asterisk (1:1.2.10.dfsg-2.dapper.2234) ubuntu-dapper; urgency=low
+
+ [ Thiago Martins ]
+ * asterisk_fix is now on the asterisk package.
+ * Changes in asterisk_fix.
Shouldn't we just use a debian/asterisk.install file?
I don't think we want to install under /usr/share/asterisk/bin/asterisk_fix,
wouldn't /usr/bin/asterisk_fix be better?
+ * Ripped and ported asterisk.postinst.debhelper to asterisk.postinst.
Why do we need to do this port?
+ * Added check_privsep_dir() in init script to manage varrun on Ubuntu and
+ remove /var/run/asterisk from asterisk package.
What is so differnt on /var/run on Ubuntu and Debian?
diff -Nru asterisk-1.2.10.dfsg/debian/asterisk_fix
asterisk-1.2.10.dfsg.new/debian/asterisk_fix
--- asterisk-1.2.10.dfsg/debian/asterisk_fix 2006-07-28
16:51:35.000000000 -0300
+++ asterisk-1.2.10.dfsg.new/debian/asterisk_fix 2006-07-28
16:45:36.000000000 -0300
@@ -1,4 +1,4 @@
-#! /bin/sh -x
+#! /bin/sh
Why have you dropped -x?
@@ -7,8 +7,14 @@
usermod -d /var/lib/asterisk asterisk
fi
else
- adduser --system --group --home /var/lib/asterisk \
+ if [ -d "/var/lib/asterisk" ]; then
+ adduser --no-create-home --system --group \
+ --home /var/lib/asterisk \
--gecos "Asterisk PBX daemon" asterisk
+ else
+ adduser --system --group --home /var/lib/asterisk \
+ --gecos "Asterisk PBX daemon" asterisk
+ fi
fi
The orig just presented a pretty harmless warning message, Your script could
stop over an existing setup which had been in place earlier?
@@ -17,13 +23,23 @@
fi
done
+# Manage base dirs
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 \
+test -d /var/log/asterisk/cdr-csv || mkdir -p /var/log/asterisk/cdr-csv
+test -d /var/log/asterisk/cdr-custom || mkdir -p /var/log/asterisk/cdr-custom
+test -d /var/spool/asterisk/dictate || mkdir -p /var/spool/asterisk/dictate
+test -d /var/spool/asterisk/meetme || mkdir -p /var/spool/asterisk/meetme
+test -d /var/spool/asterisk/monitor || mkdir -p /var/spool/asterisk/monitor
+test -d /var/spool/asterisk/system || mkdir -p /var/spool/asterisk/system
+test -d /var/spool/asterisk/tmp || mkdir -p /var/spool/asterisk/tmp
+test -d /var/spool/asterisk/voicemail ||
mkdir -p /var/spool/asterisk/voicemail
+
+# Owner is asterisk
+chown -R asterisk:asterisk \
/var/log/asterisk \
- /var/run/asterisk \
/var/spool/asterisk \
/var/lib/asterisk \
/etc/asterisk
This hasn't been a problem todate, why make the changes and why have you
removed /var/run/asterisk?
@@ -50,4 +66,14 @@
#
# 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
+#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
What does this do differently?
diff -Nru asterisk-1.2.10.dfsg/debian/asterisk.init
asterisk-1.2.10.dfsg.new/debian/asterisk.init
--- asterisk-1.2.10.dfsg/debian/asterisk.init 2006-07-28
16:51:35.000000000 -0300
+++ asterisk-1.2.10.dfsg.new/debian/asterisk.init 2006-07-28
16:45:36.000000000 -0300
@@ -69,6 +69,15 @@
set -e
+check_privsep_dir() {
+ # Create the PrivSep empty dir if necessary
+ if [ ! -d /var/run/asterisk ]; then
+ mkdir /var/run/asterisk
+ chown asterisk:asterisk /var/run/asterisk
+ chmod 0775 /var/run/asterisk
+ fi
+}
+
What does this do differently than what the orig did?
@@ -91,6 +100,7 @@
exit 0
;;
start)
+ check_privsep_dir
if status > /dev/null; then
echo "$DESC is already running. Use restart."
exit 1
@@ -140,6 +150,7 @@
echo "."
;;
reload)
+ check_privsep_dir
echo "Reloading $DESC configuration files."
$DAEMON -rx 'reload'
;;
@@ -151,6 +162,7 @@
$DAEMON -rx 'extensions reload'
;;
restart|force-reload)
+ check_privsep_dir
$0 stop
$0 start
;;
What does this do differently than what the orig did?
diff -Nru asterisk-1.2.10.dfsg/debian/asterisk.postinst
asterisk-1.2.10.dfsg.new/debian/asterisk.postinst
--- asterisk-1.2.10.dfsg/debian/asterisk.postinst 1969-12-31
21:00:00.000000000 -0300
+++ asterisk-1.2.10.dfsg.new/debian/asterisk.postinst 2006-07-28
16:45:36.000000000 -0300
@@ -0,0 +1,17 @@
+#! /bin/sh
+
+set -e
+
+# Automatically added (ripped) by dh_installinit
+if [ -x "/etc/init.d/asterisk" ]; then
+ update-rc.d asterisk defaults 21 >/dev/null
+ if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
+ if [ -f /var/run/asterisk/asterisk.pid ];then
+ invoke-rc.d asterisk reload || exit $?
+ else
+ /etc/init.d/asterisk start || exit $?
+ fi
+ fi
+fi
+# End automatically added (ripped) section
Why put this in here?
diff -Nru asterisk-1.2.10.dfsg/debian/changelog
asterisk-1.2.10.dfsg.new/debian/changelog
+
asterisk (1:1.2.10.dfsg-2.dapper.2114) ubuntu-dapper; urgency=low
* SVN snapshot for the pkg-voip team.
diff -Nru asterisk-1.2.10.dfsg/debian/rules
asterisk-1.2.10.dfsg.new/debian/rules
--- asterisk-1.2.10.dfsg/debian/rules 2006-07-28 16:51:35.000000000 -0300
+++ asterisk-1.2.10.dfsg.new/debian/rules 2006-07-28 16:45:36.000000000 -0300
@@ -144,13 +144,15 @@
dh_testdir
dh_testroot
dh_clean -k
- dh_installdirs var/run/asterisk
# Add here commands to install the package into debian/<packagename>
$(MAKE) DESTDIR=$(CURDIR)/debian/tmp install samples
cp channels/h323/h323.conf.sample
$(CURDIR)/debian/tmp/etc/asterisk/h323.conf
mkdir -p $(CURDIR)/debian/tmp/etc/default/
cp debian/asterisk.default $(CURDIR)/debian/tmp/etc/default/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/lib/cgi-bin/asterisk/
cp contrib/scripts/vmail.cgi $(CURDIR)/debian/tmp/usr/lib/cgi-bin/asterisk/
chmod +x $(CURDIR)/debian/tmp/usr/lib/cgi-bin/asterisk/vmail.cgi
Mark
More information about the Pkg-voip-maintainers
mailing list