/etc/default/X and upstart jobs

Steve Langasek steve.langasek at ubuntu.com
Thu Mar 24 00:24:48 UTC 2011

Hi Clint,

On Mon, Mar 14, 2011 at 03:44:40PM -0700, Clint Byrum wrote:

> Then the dh_installinit program should add code like this to the
> maintainer script for upgrades:

> service=ssh
> jobfile=/etc/init/$service.conf
> defaults=/etc/default/$service

> if [ -f "$defaults" -a -f "$jobfile" ] ; then
>   for i in `awk -F"^env " '/^env / {print $2}' $jobfile` ; do 
>     name=`echo $i | cut -d= -f1`
>     val=`echo $i | cut -d= -f2-`
>     setvalue=`sh -c ". $defaults ; echo \\$\$name"` 
>     if [ "$setvalue" != "val" ] ; then 
>       finalvalue=`echo $setvalue | sed -e 's/,/\,/g'`
>       sed -ie \
>         "s,^env $name=.*,#converted automatically from $default\, content saved in /var/backups/$service.default-deprecated\nenv $name=$finalvalue," \
>         $jobfile   
>     fi
>     mv $defaults /var/backups/$service.default-deprecated
>   done
> fi

I think this kind of upgrade handling is a good idea in general, but I don't
think it's reliable enough for us to make dh_installinit do it
automatically.  Please provide this as an opt-in helper of some kind (maybe
just a web page with a copy-and-pasteable snippet that can be used here) - I
wouldn't like us to introduce new bugs in the process of fixing these old

> This shouldn't count as a policy violation where a maintainer script is
> editing a conffile, because we're simply folding modifications
> to /etc/default/foo into /etc/init/foo.conf. They were going to get a
> conffile warning about /etc/default/foo .. so now they're going to get
> it about /etc/init/foo.conf, and it will include automatic configuration
> warnings so they know how it happened.

Well, it is a policy violation, but it may still be the lesser evil.  Policy
also mandates that user configuration changes are preserved, which leaving
an unused 'defaults' file around fulfills the letter of but not the spirit.

> So, does anybody

> a) think we need a UDS session to discuss this

> and/or

> b) want to +1 on this so I can start filing wishlist bugs targetted at
> oneiric?

I'm guessing a UDS session wouldn't make a very good forum for discussing
this; I think I'd prefer to see us iterate the implementation via the
mailing list where people can digest the design over time.

> Also this brings up another question.. where do we actually state our
> policy differences from Debian policy?

It looks like /usr/share/doc/ubuntu-policy/changelog.gz might detail this.

Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
Ubuntu Developer                                    http://www.debian.org/
slangasek at ubuntu.com                                     vorlon at debian.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 828 bytes
Desc: Digital signature
URL: <https://lists.ubuntu.com/archives/ubuntu-devel/attachments/20110323/5d2e000d/attachment.pgp>

More information about the ubuntu-devel mailing list