[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How to rename a ucf-conffile?



On Tue, Jul 02, 2013 at 10:38:25PM +0200, Paul Gevers wrote:
> On 02-07-13 21:42, Marc Haber wrote:
> > Is this really as easy as
> > 
> > if [ -e /etc/powerdns/pdns.d/pdns.local ]; then
> >   if [ -e /etc/powerdns/pdns.d/pdns.local.conf ]; then
> >     *bomb out*
> >     exit 1
> >   fi
> >   ucfr --purge pdns-server /etc/powerdns/pdns.d/pdns.local
> >   mv /etc/powerdns/pdns.d/pdns.local /etc/powerdns/pdns.d/pdns.local.conf
> >   ucf /usr/share/powerdns/pdns.local.conf /etc/powerdns/pdns.d/pdns.local.conf
> >   ucfr pdns-server /etc/powerdns/pdns.d/pdns.local.conf
> > fi
> > 
> > or will this break in some situations?
> 
> I recently thought about it for cacti. Maybe you can find the answer here:
> http://anonscm.debian.org/gitweb/?p=pkg-cacti/cacti.git;a=commit;h=5c8640af6857fb5660d89e5291f84994c730b3da

That code was only added in May, with 0.8.8a+dfsg-6, right? Do you
feel that it has gotten enough test coverage to snarf it yet?

Did you on purpose decide not to bomb out if the new file does already
exist?

> One point I tried to assure is that maybe the admin has removed the file
> and you want to honor that (i.e. let ucf/ucfr know that the file is
> removed). Maybe it could be done better, but this seemed to work.

Good point.

The code you have written will probably ask the user a question about
$newfile and then zap the file. Is this intended? Why not ucf
--debconf-ok /dev/null $newfile?

Greetings
Marc

-- 
-----------------------------------------------------------------------------
Marc Haber         | "I don't trust Computers. They | Mailadresse im Header
Mannheim, Germany  |  lose things."    Winona Ryder | Fon: *49 621 31958061
Nordisch by Nature |  How to make an American Quilt | Fax: *49 621 31958062


Reply to: