bird3 package upgrades - graceful restart?
Hello, since we moved from debian packages to your package repo (pkg.labs.nic.cz) we probably will see more regular updates. Therefor we are curious whether a bird3 package update will interrupt packet forwarding on a BIRD3 BGP router? For example now with the current pending update apt list --upgradable bird3/trixie 3.2.0-cznic.1~trixie amd64 [upgradable from: 3.1.5-cznic.1~trixie] Should we manually run "birdc graceful restart" before running "apt upgrade" or is this done automatically on package upgrades? best regards, Christoph relevant config snippets: /etc/bird/envvars: BIRD_RUN_USER=bird BIRD_RUN_GROUP=bird BIRD_ARGS=-R bird.conf snippets: [...] protocol kernel { ipv4 { export all; }; graceful restart yes; persist yes; learn yes; } protocol kernel { ipv6 { export all; }; graceful restart yes; persist yes; learn yes; } template bgp bgp_base4 { graceful restart on; [...]
Hello! On Mon, Jan 05, 2026 at 12:36:19AM +0100, Christoph via Bird-users wrote:
Therefor we are curious whether a bird3 package update will interrupt packet forwarding on a BIRD3 BGP router?
The package update does not restart BIRD by itself. One must do it manually or scripted themselves.
For example now with the current pending update
apt list --upgradable bird3/trixie 3.2.0-cznic.1~trixie amd64 [upgradable from: 3.1.5-cznic.1~trixie]
Should we manually run "birdc graceful restart" before running "apt upgrade" or is this done automatically on package upgrades?
You should probably switch the order, i.e. first install the new binary and then run the restart. I have no idea whether systemd could execute different variants of restart and shutdown, but if it is possible to do so, we might extend our service file in order to execute the restart/shutdown gracefully, regularly or by killing the daemon. Or set the behavior by an env var? What do you think? Have a nice day! Maria -- Maria Matejka (she/her) | BIRD Team Leader | CZ.NIC, z.s.p.o.
Hello, Maria Matejka via Bird-users:
On Mon, Jan 05, 2026 at 12:36:19AM +0100, Christoph via Bird-users wrote:
Therefor we are curious whether a bird3 package update will interrupt packet forwarding on a BIRD3 BGP router?
The package update does not restart BIRD by itself. One must do it manually or scripted themselves.
We updated bird3 now and bird got restarted automatically in this process (which is the usual behavior for debian package updates unrelated to bird). apt install bird3 Upgrading: bird3 Summary: Upgrading: 1, Installing: 0, Removing: 0, Not Upgrading: 2 Download size: 1,083 kB Get:1 https://pkg.labs.nic.cz/bird3 trixie/main amd64 bird3 amd64 3.2.0-cznic.1~trixie [1,083 kB] Fetched 1,083 kB in 0s (11.1 MB/s) Reading changelogs... Done (Reading database ... 60038 files and directories currently installed.) Preparing to unpack .../bird3_3.2.0-cznic.1~trixie_amd64.deb ... Unpacking bird3 (3.2.0-cznic.1~trixie) over (3.1.5-cznic.1~trixie) ... Setting up bird3 (3.2.0-cznic.1~trixie) ... Processing triggers for man-db (2.13.1-1) ... At the same time in the log shows the restart without manually triggering it: Jan 05 11:51:47 Stopping bird.service - BIRD Internet Routing Daemon... Jan 05 11:51:52 bird.service: Deactivated successfully. Jan 05 11:51:52 Stopped bird.service - BIRD Internet Routing Daemon. Jan 05 11:51:52 bird.service: Consumed 49min 40.707s CPU time, 1.3G memory peak. Jan 05 11:51:52 Starting bird.service - BIRD Internet Routing Daemon... Jan 05 11:51:52 Started bird.service - BIRD Internet Routing Daemon.
I have no idea whether systemd could execute different variants of restart and shutdown, but if it is possible to do so, we might extend our service file in order to execute the restart/shutdown gracefully, regularly or by killing the daemon.
Or set the behavior by an env var? What do you think?
Since the package update automatically restarts the bird systemd service I guess this is what people are used to already so it might be hard to change that? best regards, Christoph
Therefor we are curious whether a bird3 package update will interrupt packet forwarding on a BIRD3 BGP router?
The package update does not restart BIRD by itself. One must do it manually or scripted themselves.
We updated bird3 now and bird got restarted automatically in this process (which is the usual behavior for debian package updates unrelated to bird).
In my case it stayed untouched. I'm running Debian 13 Trixie, was updating from 3.1.4 to 3.2.0, and the bird version shown by the CLI was still 3.1.4 until I restarted it manually 5 minutes later.
At the same time in the log shows the restart without manually triggering it:
Jan 05 11:51:47 Stopping bird.service - BIRD Internet Routing Daemon... Jan 05 11:51:52 bird.service: Deactivated successfully. Jan 05 11:51:52 Stopped bird.service - BIRD Internet Routing Daemon. Jan 05 11:51:52 bird.service: Consumed 49min 40.707s CPU time, 1.3G memory peak. Jan 05 11:51:52 Starting bird.service - BIRD Internet Routing Daemon... Jan 05 11:51:52 Started bird.service - BIRD Internet Routing Daemon.
That's weird. I have no idea how this happened to you. We don't request for the restart anywhere. Will run tests and check whether we can replicate this behavior on our side.
I have no idea whether systemd could execute different variants of restart and shutdown, but if it is possible to do so, we might extend our service file in order to execute the restart/shutdown gracefully, regularly or by killing the daemon.
Or set the behavior by an env var? What do you think?
Since the package update automatically restarts the bird systemd service I guess this is what people are used to already so it might be hard to change that?
Autorestart is wrong by itself imho. If nothing else, APT should at least _ask_, not restart on update. One could get disconnected by autorestarting BIRD. Maria -- Maria Matejka (she/her) | BIRD Team Leader | CZ.NIC, z.s.p.o.
Maria Matejka via Bird-users:
At the same time in the log shows the restart without manually triggering it:
Jan 05 11:51:47 Stopping bird.service - BIRD Internet Routing Daemon… Jan 05 11:51:52 bird.service: Deactivated successfully. Jan 05 11:51:52 Stopped bird.service - BIRD Internet Routing Daemon. Jan 05 11:51:52 bird.service: Consumed 49min 40.707s CPU time, 1.3G memory peak. Jan 05 11:51:52 Starting bird.service - BIRD Internet Routing Daemon… Jan 05 11:51:52 Started bird.service - BIRD Internet Routing Daemon.
That’s weird. I have no idea how this happened to you. We don’t request for the restart anywhere. Will run tests and check whether we can replicate this behavior on our side.
Oh interesting also Debian 14 Trixie here. One more information: During the upgrade apt asked me whether I want to replace /etc/bird/bird.conf because it changed upstream in the usual ncurses interface. I selected 'keep the current configuration' or similar. If there are other testers that can confirm what I'm seeing (autorestart on upgrade), please join. thanks! Christoph
Hi, do you guys by any chance have the utility `needrestart` on your system? From what I was able to find it is sometimes used to extend `apt` with exactly this auto-restart functionality. If you do have it installed and `sudo cat /etc/needrestart/needrestart.conf | grep {restart}` outputs `$nrconf{restart} = 'a';` then it is this utility restarting the BIRD deamon. If not, we need to look into it further :) Thanks, David David Petera (he/him) | BIRD Tech Support | CZ.NIC, z.s.p.o. On 1/5/26 15:49, Christoph via Bird-users wrote:
Maria Matejka via Bird-users:
At the same time in the log shows the restart without manually triggering it:
Jan 05 11:51:47 Stopping bird.service - BIRD Internet Routing Daemon… Jan 05 11:51:52 bird.service: Deactivated successfully. Jan 05 11:51:52 Stopped bird.service - BIRD Internet Routing Daemon. Jan 05 11:51:52 bird.service: Consumed 49min 40.707s CPU time, 1.3G memory peak. Jan 05 11:51:52 Starting bird.service - BIRD Internet Routing Daemon… Jan 05 11:51:52 Started bird.service - BIRD Internet Routing Daemon.
That’s weird. I have no idea how this happened to you. We don’t request for the restart anywhere. Will run tests and check whether we can replicate this behavior on our side.
Oh interesting also Debian 14 Trixie here. One more information: During the upgrade apt asked me whether I want to replace /etc/bird/bird.conf because it changed upstream in the usual ncurses interface. I selected 'keep the current configuration' or similar.
If there are other testers that can confirm what I'm seeing (autorestart on upgrade), please join.
thanks! Christoph
David Petera via Bird-users:
Hi,
do you guys by any chance have the utility `needrestart` on your system?
It does not appear to be installed: dpkg -l needrestart dpkg-query: no packages found matching needrestart ls /etc/needrestart/ ls: cannot access '/etc/needrestart/': No such file or directory best regards, Christoph
On Mon, Jan 05, 2026 at 09:49:37PM +0100, Christoph via Bird-users wrote:
David Petera via Bird-users:
Hi,
do you guys by any chance have the utility `needrestart` on your system?
It does not appear to be installed:
I had a quick look at the package and it seems that the postinst script contains the following autogenerated snippet, that could also be the culprit: | # Automatically added by dh_installinit/13.24.2 | if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then | if [ -z "$DPKG_ROOT" ] && [ -x "/etc/init.d/bird" ]; then | update-rc.d bird defaults >/dev/null | if [ -n "$2" ]; then | _dh_action=restart | else | _dh_action=start | fi | invoke-rc.d bird $_dh_action || exit 1 | fi | fi | # End automatically added section I am not too proficient in debian packaging nor I am running BIRD on a Debian system currently, but I think the `configure` action is part of package upgrade, so this could also be a culprit? (I have no idea under what circumstances is `$DPKG_ROOT` populated, though.) I cannot verify that this really is the culprit, but if it is, I think, according to dh_installinit(1) manpage, that `distro/pkg/deb/rules` should use `--no-restart-on-upgrade` in `override_dh_installinit` (and possibly in `override_dh_installsystemd` too?) Again, take this with some amount of salt, I was just curious and opened the .deb in midnight commander and made some guesses :-) Best regards, LEdoian
On 2026-01-05 07:39, Maria Matejka via Bird-users wrote:
The package update does not restart BIRD by itself. One must do it manually or scripted themselves.
In the postinst, you have: # Automatically added by dh_installinit/13.24.2 if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then if [ -z "$DPKG_ROOT" ] && [ -x "/etc/init.d/bird" ]; then update-rc.d bird defaults >/dev/null if [ -n "$2" ]; then _dh_action=restart else _dh_action=start fi invoke-rc.d bird $_dh_action || exit 1 fi fi # End automatically added section So, if there is /etc/init.d/bird, it will be restarted (through invoke-rc.d which will invoke systemd). Maybe your system has /usr/sbin/policy-rc.d preventing that? Or you deleted /etc/init.d/bird? If the source is here, it confirms there is a restart after upgrade. You should use --no-stop-on-upgrade to avoid an upgrade to restart the daemon. I didn't try myself, so I may be wrong. 90% sure I am not ;-)
participants (5)
-
Christoph -
David Petera -
LEdoian -
Maria Matejka -
Vincent Bernat