Discussion:
[PATCH] bird.init: Added a check_config function and call it prior of, start and reload
Pavlos Parissis
2014-10-05 19:47:08 UTC
Permalink
Hi,

This another patch for the init script which adds a check_config
function and call it prior of, start and reload.

It should be applied on top the other patch I sent on 2nd Sep.

Cheers,
Pavlos
Dmitry S. Nikolaev
2014-10-06 04:05:44 UTC
Permalink
Hi.

Thanks for patch but hardcoded path:

/usr/sbin/"${_bird}" -p -c /etc/"${_bird}".conf

It`s not good for (such as) FreeBSD users.

# whereis bird
bird: /usr/local/sbin/bird /usr/ports/net/bird

Default path to config: /usr/local/etc/bird.conf /usr/local/etc/bird6.conf
I use path to config: /usr/local/etc/bird/bird.conf
/usr/local/etc/bird/bird6.conf

---
With best regards, Dmitry S. Nikolaev

Moscow, Russia
Post by Pavlos Parissis
Hi,
This another patch for the init script which adds a check_config
function and call it prior of, start and reload.
It should be applied on top the other patch I sent on 2nd Sep.
Cheers,
Pavlos
Pavlos Parissis
2014-10-06 21:05:01 UTC
Permalink
Post by Dmitry S. Nikolaev
Hi.
/usr/sbin/"${_bird}" -p -c /etc/"${_bird}".conf
It`s not good for (such as) FreeBSD users.
# whereis bird
bird: /usr/local/sbin/bird /usr/ports/net/bird
Default path to config: /usr/local/etc/bird.conf /usr/local/etc/bird6.conf
I use path to config: /usr/local/etc/bird/bird.conf
/usr/local/etc/bird/bird6.conf
But there are already paths hardcoded in the init script I found on the
repo. I failed to find any other scripts and I don't have access to BSD
systems. Does the current script work on BSD?

Thanks for getting back to me!
Pavlos
Ondrej Filip
2014-10-06 21:23:04 UTC
Permalink
Post by Pavlos Parissis
Post by Dmitry S. Nikolaev
Hi.
/usr/sbin/"${_bird}" -p -c /etc/"${_bird}".conf
It`s not good for (such as) FreeBSD users.
# whereis bird bird: /usr/local/sbin/bird /usr/ports/net/bird
Default path to config: /usr/local/etc/bird.conf
/usr/local/etc/bird/bird.conf /usr/local/etc/bird/bird6.conf
But there are already paths hardcoded in the init script I found
on the repo. I failed to find any other scripts and I don't have
access to BSD systems. Does the current script work on BSD?
Hi!
I created this script especially for Redhat/Fedora distribution. As
Fedora does not need this script, I stopped supporting it. I think
all the other packagers you theirs own scripts.

Ondrej
Post by Pavlos Parissis
Thanks for getting back to me! Pavlos
Ondrej Zajicek
2014-10-06 21:24:16 UTC
Permalink
Post by Pavlos Parissis
Post by Dmitry S. Nikolaev
Hi.
/usr/sbin/"${_bird}" -p -c /etc/"${_bird}".conf
It`s not good for (such as) FreeBSD users.
# whereis bird
bird: /usr/local/sbin/bird /usr/ports/net/bird
Default path to config: /usr/local/etc/bird.conf /usr/local/etc/bird6.conf
I use path to config: /usr/local/etc/bird/bird.conf
/usr/local/etc/bird/bird6.conf
But there are already paths hardcoded in the init script I found on the
repo. I failed to find any other scripts and I don't have access to BSD
systems. Does the current script work on BSD?
I don't think so, it is not even used in Debian. I mostly ignored it as i
was not aware whether it is used anywhere or it is just some historic
relict, but it is probably used in RedHat, i guess?
--
Elen sila lumenn' omentielvo

Ondrej 'Santiago' Zajicek (email: ***@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."
Pavlos Parissis
2014-10-06 21:27:42 UTC
Permalink
Post by Ondrej Zajicek
Post by Pavlos Parissis
Post by Dmitry S. Nikolaev
Hi.
/usr/sbin/"${_bird}" -p -c /etc/"${_bird}".conf
It`s not good for (such as) FreeBSD users.
# whereis bird
bird: /usr/local/sbin/bird /usr/ports/net/bird
Default path to config: /usr/local/etc/bird.conf /usr/local/etc/bird6.conf
I use path to config: /usr/local/etc/bird/bird.conf
/usr/local/etc/bird/bird6.conf
But there are already paths hardcoded in the init script I found on the
repo. I failed to find any other scripts and I don't have access to BSD
systems. Does the current script work on BSD?
I don't think so, it is not even used in Debian. I mostly ignored it as i
was not aware whether it is used anywhere or it is just some historic
relict, but it is probably used in RedHat, i guess?
Yes, it used in Redhat. Debian ships a different one where they have
split to 2, one for each version of IP.

Cheers,
Pavlos
Ondrej Zajicek
2014-10-06 21:18:07 UTC
Permalink
Post by Pavlos Parissis
Hi,
This another patch for the init script which adds a check_config
function and call it prior of, start and reload.
Hi

Why to do this? Explicit checking of config has some specific use cases
but it is IMHO pointless in standard init scripts. If we need return
values (to see if BIRD was properly started or reconfigured), we should
get proper return values from the primary commands (that means that
'birdc configure' should be used for reconfiguration instead of sending
HUP and i should ensure that birdc returns proper error code)
--
Elen sila lumenn' omentielvo

Ondrej 'Santiago' Zajicek (email: ***@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."
Pavlos Parissis
2014-10-06 21:35:44 UTC
Permalink
Post by Ondrej Zajicek
Post by Pavlos Parissis
Hi,
This another patch for the init script which adds a check_config
function and call it prior of, start and reload.
Hi
Why to do this?
Because it is needed for integration with configuration management
tools(Puppet, chef and etc). Without the patch these tools are unaware
that they just pushed a broken configuration. Bird operation is not
effected as it doesn't load broken configuration.
Post by Ondrej Zajicek
Explicit checking of config has some specific use cases
but it is IMHO pointless in standard init scripts. If we need return
values (to see if BIRD was properly started or reconfigured), we should
get proper return values from the primary commands (that means that
'birdc configure' should be used for reconfiguration instead of sending
HUP and i should ensure that birdc returns proper error code)
I was wondering why init script was not calling birdcl configure rather
sending HUP, but I guess because it is not actively used/maintained.

What would be the consequence of sending HUP rather calling birdcl
configure, if any?

Thanks,
Pavlos
Ondrej Zajicek
2014-10-06 21:54:10 UTC
Permalink
Post by Pavlos Parissis
Post by Ondrej Zajicek
Post by Pavlos Parissis
Hi,
This another patch for the init script which adds a check_config
function and call it prior of, start and reload.
Hi
Why to do this?
Because it is needed for integration with configuration management
tools(Puppet, chef and etc). Without the patch these tools are unaware
that they just pushed a broken configuration. Bird operation is not
effected as it doesn't load broken configuration.
Post by Ondrej Zajicek
Explicit checking of config has some specific use cases
but it is IMHO pointless in standard init scripts. If we need return
values (to see if BIRD was properly started or reconfigured), we should
get proper return values from the primary commands (that means that
'birdc configure' should be used for reconfiguration instead of sending
HUP and i should ensure that birdc returns proper error code)
I was wondering why init script was not calling birdcl configure rather
sending HUP, but I guess because it is not actively used/maintained.
What would be the consequence of sending HUP rather calling birdcl
configure, if any?
AFAIK the only consequence is that you cannot get the return value and
eventual error messages are handled differently (send to the log instead
of returned to birdc). I just checked that birdc/birdcl does not forward
the return value, but that is something that probably should be fixed.
--
Elen sila lumenn' omentielvo

Ondrej 'Santiago' Zajicek (email: ***@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."
Loading...