Skip to contentSkip to conversation

Makefile: use systemd-tmpfiles to create /var/lib/arpd

PATCH Max Gautier 1 participant 1 message Mar 13, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw
Quoted 38 lines · Stephen Hemminger
Quoted 35 lines · On Tue, 12 Mar 2024 22:34:59 +0100 Max Gautier <[email protected]> wrote:
Quoted 33 lines · Stephen Hemminger
Quoted 18 lines · On Tue, 12 Mar 2024 09:22:20 +0100 Max Gautier <[email protected]> wrote:
Quoted 17 lines · Stephen Hemminger
Quoted 14 lines · On Mon, 11 Mar 2024 23:28:31 +0100 Max Gautier <[email protected]> wrote:
Quoted 13 lines · Stephen Hemminger
Quoted 9 lines · On Mon, 11 Mar 2024 17:57:27 +0100 Max Gautier <[email protected]> wrote:

Only apply on systemd systems (detected in the configure script). The motivation is to build distributions packages without /var to go towards stateless systems, see link below (TL;DR: provisionning anything outside of /usr on boot).

The feature flag can be overridden on make invocation:
make USE_TMPFILES_D=n DESTDIR=<install_loc> install

Links: https://0pointer.net/blog/projects/stateless.html

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
Quoted 1 line

Why does arpd need such hand holding, it is rarely used, maybe should just not be built.

The commit introducing the install of that directory is quite old

The problem is that build environment != runtime environment for embedded systems.

That's the same for anything detected by the configure script, right ? Hence the override capability.

Configure is mostly about what packages are missing from the build. It would be better if arpd was just smarter about where to put its file.

Quoted 6 lines
Quoted 3 lines

What do you mean by smarter ? Trying to found an existing directory rather than a fixed one ?

Isn't there some environment variable that systemd uses to tell a service where to put its files? If that is present use that.

Yeah there is StateDirectory that could be used for this (set STATE_DIRECTORY in the process). I would have done that, but there is no systemd service file for arpd, and I don't know which options combination should be preferred for the arpd invocation in the potential service file.

On another note, I see in the examples sections of the man page the following:

Quoted 7 lines

arpd -b /var/tmp/arpd.db
Start arpd to collect gratuitous ARP, but not messing with ker‐ nel functionality.

killall arpd ; arpd -l -b /var/tmp/arpd.db
Look at result after some time.

Quoted 8 lines

arpd -b /var/tmp/arpd.db -a 1 eth0 eth1
Enable kernel helper, leaving leading role to kernel.

arpd -b /var/tmp/arpd.db -a 3 -k eth0 eth1
Completely replace kernel resolution on interfaces eth0 and eth1. In this case the kernel still does unicast probing to val‐ idate entries, but all the broadcast activity is suppressed and made under authority of arpd.

Looks like all examples use /var/tmp/arpd.db. Maybe that means that should be the default instead ?

(forgot to cc the list)

Signature · 1 line
Max Gautier