Bug#784852: bird: example configuration / conffiles

2015-05-11 Thread Ondrej Zajicek
On Tue, May 12, 2015 at 12:27:58AM +0200, Hans van Kranenburg wrote:
 Hi,
 
 We (Christian, me, some others) had some discussions on IRC (#bird,
 freenode) related to the configuration file handling in the bird debian
 package. This message relays most of the discussion to this debian bug
 report:

Hi

I, as a BIRD developer, pretty much agree with all your points and
suggestions. I should prepare some reasonable default bird[6].conf and
separate example bird[6].conf in the upstream package for use in Debian
and other distributions.

-- 
Elen sila lumenn' omentielvo

Ondrej 'Santiago' Zajicek (email: santi...@crfreenet.org)
OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net)
To err is human -- to blame it on a computer is even more so.


signature.asc
Description: Digital signature


Bug#784852: bird: example configuration / conffiles

2015-05-11 Thread Hans van Kranenburg

Hi,

We (Christian, me, some others) had some discussions on IRC (#bird, 
freenode) related to the configuration file handling in the bird debian 
package. This message relays most of the discussion to this debian bug 
report:


1. contents of the default configuration file

The configuration file that is put at /etc/bird/bird.conf and 
/etc/bird/bird6.conf is a copy of an example configuration file from the 
bird source (doc/bird.conf.example).


The configuration example seems to contain a fairly broad selection of 
all possible things you can do in a configuration file, and which 
options and constructs you could use, but is not very useful as an 
example for a new user to build an actual bird config. For a new user, 
this file is confusing, scary and it contains options which nearly 
nobody will ever need (like an enabled rfc1583compat).


Besides that, the same file is copied to bird6.conf, while it contains a 
lot of IPv4 addresses, which does not make sense.


2. having it as conffile

Because changing the configuration file will need to happen in all cases 
(to set the router id and add any configuration to make bird do useful 
things), it does not make a lot of sense to have this file as conffile 
in the package. The question about if we want to keep the current file, 
install a changed example file from the package, or merge changes will 
always be answered with N, keep the current file.


At least, I've never done anything else with it than first of all 
removing everything in it before putting my own config in.


Another practical benefit of getting rid of the questions when upgrading 
is that you don't end up with a non-responding terminal when you forget 
to log in via a proper way and lose the connection to the open shell 
where the question is stated, because bird has been stopped and dpkg is 
waiting for an answer that will never arrive. :D


3. So, suggestions are:

Do not use a dpkg maintained configfile, but a postinst maintained one, 
https://www.debian.org/doc/debian-policy/ap-pkg-conffiles.html#sE.2 and 
let postinst install a simple configfile, but only, and only if there is 
no configfile in place yet.


Maybe put the example configuration file in 
/usr/share/doc/bird/examples/bird.conf


The current configfile contains the router id line with router id 
198.51.100.1; in order to be able to start bird6 at all.


Instead of introducting debconf complexity for only this parameter, I'd 
vote to just let the user configure the whole file, and clearly state 
that the router id which is in there by default has to be changed.


See attachment for a suggestion of a new file which could be put into 
place at bird.conf and bird6.conf when the files are not present yet (at 
first install or after purge/reinstall).


Regards,

--
Hans van Kranenburg - System / Network Engineer
T +31 (0)10 2760434 | hans.van.kranenb...@mendix.com | www.mendix.com
# This is a minimal configuration file, which allows the bird daemon to start
# but will not cause anything else to happen.
#
# Please refer to the documentation in the bird-doc package or BIRD User's
# Guide on http://bird.network.cz/ for more information on configuring BIRD and
# adding routing protocols.

# Change this into your BIRD router ID. It's a world-wide unique identification
# of your router, usually one of router's IPv4 addresses.
router id 198.51.100.1;

# The Kernel protocol is not a real routing protocol. Instead of communicating
# with other routers in the network, it performs synchronization of BIRD's
# routing tables with the OS kernel.
protocol kernel {
scan time 60;
import none;
#   export all;   # Actually insert routes into the kernel routing table
}

# The Device protocol is not a real routing protocol. It doesn't generate any
# routes and it only serves as a module for getting information about network
# interfaces from the kernel. 
protocol device {
scan time 60;
}