bird systemd startup init debian

Rob Lister rob at lonap.net
Tue Mar 6 11:57:09 CET 2018


On 2018-03-06 09:42, Wilco Baan Hofman wrote:
>> I need to specify during startup "-c /path/to/config/file" but 
>> whatever
>> I do, it just gets ignored and still tries to use /etc/bird/bird.conf
>> 
>> I have tried:
>> 
>> - Editing /etc/init.d/bird and adding BIRD_ARGS="-c
>> /etc/bird/bird-vlanid1-ipv4.conf"
>> - Editing /etc/defaults/bird (deprecated??)
> 
> Editing arguments should be done in /etc/defaults/bird, not in 
> /etc/init.d.

Yes, I tried both and neither worked, though the file does not exist by 
default
(this is where the options are changed on our existing route servers.)


>> - Editing /etc/bird/envvars
>> - Editing the systemctl with "systemctl edit bird.service" as 
>> suggested
>> here:
>> 
>> https://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg1503154.html
>> 
>> - Restarting systemctl daemon-reload
> 
> This only re-reads the systemd configuration file. Try "service bird
> restart" (because reload only causes bird to reread the bird config and
> if you want new command line arguments, restart bird)

Yes, tried that but it won't start while it can't find 
/etc/bird/bird.conf, and I can't seem to tell it to use an alternative 
configuration file. I've tried all of:-

root at rs1f:/etc/bird# cat /etc/bird/envvars
BIRD_RUN_USER=bird
BIRD_RUN_GROUP=bird
BIRD_ARGS="-c /etc/bird/bird-vlanid1-ipv4.conf"

root at rs1f:/etc/bird# cat 
/etc/systemd/system/bird.service.d/override.conf
# bird.service
[Service]
ExecStart=
ExecStart=/usr/sbin/bird -c /etc/bird/bird-vlanid1-ipv4.conf -f -u 
$BIRD_RUN_USER -g $BIRD_RUN_GROUP $BIRD_ARGS -P /var/run/bird/bird.pid

root at rs1f:/etc/bird# grep BIRD_ARGS /etc/init.d/bird
BIRD_ARGS="-c /etc/bird/bird-vlanid1-ipv4.conf"

root at rs1f:/etc/default# cat /etc/default/bird
#
# This is a POSIX shell fragment
#

# Additional options that are passed to the Daemon.
BIRD_ARGS="-c /etc/bird/bird-vlanid1-ipv4.conf -s 
/var/run/bird/bird-vlanid1-ipv4.ctl"


Also tried the old "DAEMON_ARGS" here but doesn't look like the script 
uses it.


But whatever I try doesn't get passed to bird:-


root at rs1f:/etc/bird# service bird start
Job for bird.service failed because the control process exited with 
error code.
See "systemctl status bird.service" and "journalctl -xe" for details.

root at rs1f:/etc/bird# systemctl status bird.service
● bird.service - BIRD Internet Routing Daemon (IPv4)
    Loaded: loaded (/lib/systemd/system/bird.service; enabled; vendor 
preset: enabled)
   Drop-In: /etc/systemd/system/bird.service.d
            └─override.conf
    Active: failed (Result: exit-code) since Mon 2018-03-05 19:16:16 UTC; 
8s ago
   Process: 510 ExecStartPre=/usr/sbin/bird -p (code=exited, 
status=1/FAILURE)
   Process: 504 ExecStartPre=/usr/lib/bird/prepare-environment 
(code=exited, status=0/SUCCESS)

Mar 05 19:16:16 rs1f.lonap.net systemd[1]: Starting BIRD Internet 
Routing Daemon (IPv4)...
Mar 05 19:16:16 rs1f.lonap.net bird[510]: Unable to open configuration 
file /etc/bird/bird.conf: No such file or directory
Mar 05 19:16:16 rs1f.lonap.net bird[510]: bird: Unable to open 
configuration file /etc/bird/bird.conf: No such file or directory
Mar 05 19:16:16 rs1f.lonap.net systemd[1]: bird.service: Control process 
exited, code=exited status=1
Mar 05 19:16:16 rs1f.lonap.net systemd[1]: Failed to start BIRD Internet 
Routing Daemon (IPv4).
Mar 05 19:16:16 rs1f.lonap.net systemd[1]: bird.service: Unit entered 
failed state.
Mar 05 19:16:16 rs1f.lonap.net systemd[1]: bird.service: Failed with 
result 'exit-code'.


Seems that /etc/bird/envvars should be being read:

/etc/init/bird.conf


root at rs1f:/etc/init# cat /lib/systemd/system/bird.service
[Unit]
Description=BIRD Internet Routing Daemon (IPv4)
After=network.target

[Service]
EnvironmentFile=/etc/bird/envvars
ExecStartPre=/usr/lib/bird/prepare-environment
ExecStartPre=/usr/sbin/bird -p
ExecReload=/usr/sbin/birdc configure
ExecStart=/usr/sbin/bird -f -u $BIRD_RUN_USER -g $BIRD_RUN_GROUP 
$BIRD_ARGS
Restart=on-abort

[Install]
WantedBy=multi-user.target


After some further investigation, It would seem that something is 
checking for /etc/bird/bird.conf during startup regardless,
and failing even if this file is not specified:

If we do:

root at rs1f:/etc/bird# ln -s bird-vlanid1-ipv4.conf bird.conf

root at rs1f:/etc/bird# service bird start

root at rs1f:/etc/bird# !ps
ps xau | grep bird
bird       313  0.0  0.0  15332  2088 ?        Ss   Mar05   0:00 
/usr/sbin/bird6 -f -u bird -g bird
bird      1609  0.0  0.0  15272  2084 ?        Ss   10:49   0:00 
/usr/sbin/bird -f -u bird -g bird -c /etc/bird/bird-vlanid1-ipv4.conf

It appears that it took my config as specified from "/etc/bird/envvars" 
but that it cannot cope with /etc/bird/bird.conf not existing.
(We tried also just a blank /etc/bird/bird.conf but it doesn't like that 
- must be valid config file.)


Rob



-- 
Rob Lister
rob at lonap.net
+44 20 3137 8330


More information about the Bird-users mailing list