:: Re: [DNG] runit setup
Etusivu
Poista viesti
Vastaa
Lähettäjä: aitor
Päiväys:  
Vastaanottaja: dng
Vanhat otsikot: Re: [DNG] New goodies from systemd
Aihe: Re: [DNG] runit setup
Hi,

On 2/8/23 16:52, Dan Pridgeon via Dng wrote:

> The dhcpcd service was filling my logs, complaining about not being
> able to bind to eth1, which my box obviously didn't have. 1) Why
> did a dhcpcd service start up when I didn't enable it, and it doesn't
> even need to run as the ifupdown framework can handle it? 2) Why does
> it have a user
> config by default, referencing eth1?


The following program prints the info about all the network device names found in a given
directory in the sysfs, even if the symlinks in `/sys/class/net` have not been created yet:

https://www.gnuinos.org/stat_net/

Build the code using the Makefile, and then run the shell script as follows:

$ ./print_net_devices /sys/devices

You can specify a subdir in `/sys/devices` to accelerate your search. Output sample:

$ ./print_net_devices /sys/devices/pci0000:00

eth0
NET_NAME_MAC=enxb8ca3a742e72
NET_NAME_PATH=enp0s25
IS_NET=TRUE

wlan0
NET_NAME_MAC=wlx60e3271f038c
NET_NAME_PATH=wlp0s29u1u2
IS_NET=TRUE

I took the code from one of the vdev helpers, which in turn was taken from (... Oh!) systemd:

https://github.com/jcnelson/vdev/blob/master/vdevd/helpers/LINUX/stat_net.c

I don't know if you will find it useful in some of your runit scripts.

Cheers,

Aitor.