Closed rzalamena closed 4 years ago
This PR is related with issue #55 .
Rebased commits to avoid polluting git history.
Changes:
Added new OpenRC init script that doesn't directly use frrinit.sh
, so we don't need bash at init.
I've also took extra precautions and I created daemon running database on start, so if the configuration changes (e.g. a daemon gets disabled) it won't leave daemons running.
Here is how the output looks like:
# rc-service frr start
* Starting FRR ... [ ok ]
# rc-service frr stop
* Stopping FRR ... [ ok ]
# # Service stop with failure:
# rc-service frr stop
* Stopping FRR ...
* Failed to stop watchfrr (PID=8787)
* Failed to stop zebra (PID=8802)
* Failed to stop staticd (PID=8807)
* Failed to stop bfdd (PID=8811)
And here is with verbose mode:
# rc-service -v frr start
* Executing: /lib/rc/sh/openrc-run.sh /lib/rc/sh/openrc-run.sh /etc/init.d/frr start
* Starting FRR ...
* Starting zebra...
* Starting staticd...
* Starting bfdd...
* Starting watchfrr...
* Loading configuration... [ ok ]
# rc-service -v frr stop
* Executing: /lib/rc/sh/openrc-run.sh /lib/rc/sh/openrc-run.sh /etc/init.d/frr stop
* Stopping FRR ...
* Stopping watchfrr...
* Stopping zebra...
* Stopping staticd...
* Stopping bfdd... [ ok ]
# # Service stop with failure:
# rc-service -v frr stop
* Executing: /lib/rc/sh/openrc-run.sh /lib/rc/sh/openrc-run.sh /etc/init.d/frr stop
* Stopping FRR ...
* Stopping watchfrr...
* Failed to stop watchfrr (PID=9138)
* Stopping zebra...
* Failed to stop zebra (PID=9153)
* Stopping staticd...
* Failed to stop staticd (PID=9158)
* Stopping bfdd...
* Failed to stop bfdd (PID=9162)
Changed ebuild indentation from spaces to tabs ( see dev manual )
It is no fun reformatting lines of ebuilds because the submitter did not follow the guidelines to use TABS rather than spaces. So please use tabs!
Added bash
as dependency since frrinit.sh
uses bashisms.
Added PAM file installation (like the old ebuilds did - thanks to @f0o as I don't know how to write those)
Added logrotate file (like the old ebuilds did)
Removed vtysh
use flag: it is mandatory to have vtysh
with watchfrr
, it does the configuration loading.
I will update the main post content with some new info.
Rebased: fixed a bug when running OSPF with multiple instances.
Rebased: added more metadata information and fixed a few file permissions/owners on FRR startup.
Rebased: changed default use flags. I removed a nhrp
from default and added its dependency (libcares).
I haven't test this new ebuild with systemd since I dont use it, but the defaults should work for it.
I think this PR is ready to be reviewed/tested by a wider public.
Summary
I'm writing a new ebuild for FRR trying to make it as compatible with other distros as possible.
Changes:
Less use flags: if someone misses them, please comment here. Flags removed:
caps
: I don't know what it does, the default should be enough.elibc_glibc
: probably not needed, we don't depend on libpcre.readline
: its a vtysh dependency and we can ask for it in build dependency variable.rpki
: sorry I know its important, but I can't test it yet.multipath
: this one makes no sense in recent FRR, with or without it you get the same result.watchfrr
: this should be no longer optional, I'll write a openrc init script that uses it.protobuf
: as far as I know it is only being used by FPM, please let me know if someone needs it.shell-access
: I don't know what happens if we disable this, better keep the default.vtysh
: this is mandatory to usewatchfrr
.Add support for build user documentation (e.g. you can read them with
firefox /usr/share/doc/frr-<version>/html/index.html
). It is always nice to be able to read the docs offline.Use the upstream default directories:
/var/run/frr
and/usr/lib/frr
.Add yacc/flex as build time dependencies only.
Disable address sanitizer by default: users probably don't want the extra memory usage and slower runtimes...
CLI will now show the package version too:
--with-pkg-extra-version="-${PVR}-gentoo"
.Use
watchfrr
by default: this might become a hard dependency in the future and upstream expect people to use it.New OpenRC script for non-systemd users.
Add run time dependency on
bash
: we need it forwatchfrr
to runfrrinit.sh
.TODO
[x] Testing
[x] OpenRC init script that uses
watchfrr