Open zajdee opened 2 years ago
Let's put this on hold. I have verified it works as expected when run as root, however when run as nobody the ip netns exec <namespace>
fails with jool failed: setting the network namespace "<name-of-the-namespace>" failed: Operation not permitted
, as the nobody
user doesn't have the rights to access the namespace.
Another alternative is to add NetworkNamespacePath=/var/run/netns/<name-of-the-namespace>
to jool-exporter.service
(working since systemd ~242) and collect the metrics using the IP within the namespace.
Strange, I would have thought the NET_ADMIN capability would have helped here for the service trying to jump into a different netns. Might be a different capability?
You're running:
AmbientCapabilities=CAP_NET_ADMIN
in your unit file yes?
But probably the NetworkNamespacePath
keeps the code simpler and works without any capability, so is probable the better way to go.
This change enables the exporter to run in the default network namespace and retrieve the statistics from Jool running in an isolated namespace.
Introduces a new argument,
-n
(--namespace
), followed by the name of the namespace.