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

Re: How to rename a ucf-conffile?



On 02-07-13 21:42, Marc Haber wrote:
> Hi,
> 
> the PowerDNS packages have shipped configuration in
> /etc/powerdns/pdns.d/foo, with the pdns.d functionality patched in by
> Debian. Upstream has recently followed our wishlist request to
> implement include-dir functionality in PowerDNS proper.
> 
> However, they require all files in an include-dir directory to be
> named foo.conf, which we did not do in the past. The PowerDNS packages
> use ucf to manage their conffiles, and we thus need to rename them.
> 
> 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

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.

Paul

Attachment: signature.asc
Description: OpenPGP digital signature


Reply to: