[PATCH] bird.init: Added a check_config function and call it prior of, start and reload
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
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 mail: dnikolaev@mega-net.ru On 05.10.2014 23:47, Pavlos Parissis wrote:
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
On 06/10/2014 06:05 πμ, Dmitry S. Nikolaev wrote:
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
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
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 6.10.2014 23:05, Pavlos Parissis wrote:
On 06/10/2014 06:05 πμ, Dmitry S. Nikolaev wrote:
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
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
Thanks for getting back to me! Pavlos
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlQzCDYACgkQgAKjwiLO7vJ7qgCdEE4mh9SanYk5jzdzPN/JpUAz KFAAnA14wIC/rIFTqZsNMdjmgaXnkb2W =wUwI -----END PGP SIGNATURE-----
On Mon, Oct 06, 2014 at 11:05:01PM +0200, Pavlos Parissis wrote:
On 06/10/2014 06:05 πμ, Dmitry S. Nikolaev wrote:
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
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: santiago@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."
On 06/10/2014 11:24 μμ, Ondrej Zajicek wrote:
On Mon, Oct 06, 2014 at 11:05:01PM +0200, Pavlos Parissis wrote:
On 06/10/2014 06:05 πμ, Dmitry S. Nikolaev wrote:
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
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
On Sun, Oct 05, 2014 at 09:47:08PM +0200, Pavlos Parissis wrote:
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: santiago@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."
On 06/10/2014 11:18 μμ, Ondrej Zajicek wrote:
On Sun, Oct 05, 2014 at 09:47:08PM +0200, Pavlos Parissis wrote:
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.
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
On Mon, Oct 06, 2014 at 11:35:44PM +0200, Pavlos Parissis wrote:
On 06/10/2014 11:18 μμ, Ondrej Zajicek wrote:
On Sun, Oct 05, 2014 at 09:47:08PM +0200, Pavlos Parissis wrote:
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.
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: santiago@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."
participants (4)
-
Dmitry S. Nikolaev -
Ondrej Filip -
Ondrej Zajicek -
Pavlos Parissis