asterisk dapper.2114_to_dapper.2234 diff

Jonas Smedegaard dr at jones.dk
Sun Aug 6 18:04:03 UTC 2006


On Wed, 02 Aug 2006 17:07:45 -0300 Thiago Martins wrote:

> Em Ter, 2006-08-01 às 16:39 +0100, Mark Purcell escreveu: 
> > 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.

> > 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.

Thanks for this clarification. I am newly subscribed to the team list
(and in another post today request membership of the team) but was
confused by the recent seemingly ubuntu-specific discussions.

I wholeheartedly agree with the above.


> > 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?
> I think we need a really declared stable distro, and Dapper is stable
> and updated. Debian sid is always different, and I want a stable
> distro for production environment.

Please let's avoid such discussion here :-)

The topic is quite interesting, but IMHO completely irrelevant for this
list (if true the earlier statement about this list being primarily
about the *Debian* packaging).


I have experienced some trouble and broken behaviour with installing
and upgrading the current asterisk packages in sarge, etch and
unstable, but have found the packaging somewhat a mess so have not yet
filed bugreports about it. I'd like to help cleaning up the packaging
and switching to using cdbs, if it is of any interest - so this thread
(when cleared up the Debian<->Ubuntu prioritation) is highly
interesting for me.

(I already maintain 40+ packages officially for Debian, most if not
all packaged with cdbs, and I wrote a bit of the core cdbs modules).


> > +  * Ripped and ported asterisk.postinst.debhelper to
> > asterisk.postinst.
> > 
> > Why do we need to do this port?
> If you try to reinstall all asterisk*.deb (except bristuff and some
> others), the default postinst from debhelper allways try to start
> asterisk, even if it already started and running, generating an error
> and the package don't become in state installed (ii).

Indeed I have experienced problems in this area too. If still an issue
(as I suspect) it is a policy violation:

    6.2. Mainainter script idempotency


> > +  * 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?
> Some things are very different, take a look on Ubuntu Dapper:

> Look at /etc/init.d/ssh on the Ubuntu, its creates /var/run/ssh every
> time. Just like my patch.

To put this more Debian-centric: There's no guarantee that /var/run is
persistent across reboots of the machine.

This might not (yet) be a policy violation, but sure neat to support
properly nonetheless.


> > 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?
> Just to see less messages...

It is a shell debug option, not for production use. I agree it should
be dropped.

Why keep it?


> > @@ -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?
> If it's harmless, forget about it... I think it's only a cosmetic
> change...

I welcome this improvement. Let's avoid warnings when possible.

But I'd recommend the following instead, to avoid duplicated code:


@@ -7,8 +7,14 @@
 		usermod -d /var/lib/asterisk asterisk
         fi
 else
+	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



> > @@ -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?
> The asterisk and some other daemons that we develop here, depends on
> this dirs. And this dirs are created in default "make && make
> install" of asterisk from Digium.
> 
> I remove /var/run/asterisk because the varrun on Ubuntu is on a
> tmpfs. Remember, this is done by the asterisk init script every time.

I for one experienced problems upgrading from one unstable package to
another due to which I narrowed down to a postinst chown'ing a
non-existing dir. All such problems might be fixed in more recent
releases, but I welcome being on the safe side. Also, even if the dirs
currently created by the Debian package is sufficient for the stuff
enabled by the default packaging, I welcome the package preparing as
much as possible, to ease enabling non-default modules.


But again, I suggest avoiding repetitions:


# 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




Regards,

 - Jonas

-- 
* Jonas Smedegaard - idealist og Internet-arkitekt
* Tlf.: +45 40843136  Website: http://dr.jones.dk/

 - Enden er nær: http://www.shibumi.org/eoti.htm
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/pkg-voip-maintainers/attachments/20060806/22a9e37b/attachment.pgp


More information about the Pkg-voip-maintainers mailing list