Re: [DNG] an alternative to poettering's ifplugd
Hi, On 18/3/19 18:37, aitor_czr wrote: Hi all, On 17/3/19 13:45, aitor_czr wrote: I'm also working on an alternative to poettering's ifplugd for the automatically wired connect option of simple-netaid. Aitor. Here you are the code: gnuinos.org/examples/netproc/main.c Install the libiw-dev and ethtool packages, and build the file: gcc main.c -liw -o main and run it in the command line: $ ./main The output will be: The wire is PLUGGED/UNPLUGGED The unplug event is detected inmediatly, but the unplug event takes a few seconds. It's working for me. I need testers. Thanks in advance :) Aitor. The ethtool dependency is superfluous, i removed the header and updated the sources in the link: http://www.gnuinos.org/examples/netproc/ Cheers, Aitor. ___ Dng mailing list Dng@lists.dyne.org https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng
Re: [DNG] an alternative to poettering's ifplugd
Hi all, On 17/3/19 13:45, aitor_czr wrote: I'm also working on an alternative to poettering's ifplugd for the automatically wired connect option of simple-netaid. Aitor. Here you are the code: gnuinos.org/examples/netproc/main.c Install the libiw-dev and ethtool packages, and build the file: gcc main.c -liw -o main and run it in the command line: $ ./main The output will be: The wire is PLUGGED/UNPLUGGED The unplug event is detected inmediatly, but the unplug event takes a few seconds. It's working for me. I need testers. Thanks in advance :) Aitor. ___ Dng mailing list Dng@lists.dyne.org https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng
Re: [DNG] new freedesktop "standard": /etc/machine-id
* On 2019 18 Mar 06:35 -0500, Olaf Meeuwissen wrote: > I wrote "the IP address is in /etc/hosts", but I think that should have > been "the IP address what your hostname resolves to" :-/ > > In many common scenarios that is likely to be the same as what is in > your /etc/hosts file, but really depends on how name resolution is > configured on your machine. > > Hope this helps, Thanks, Olaf. I just replied as it seemed like an interesting thought exercise. :-) - Nate -- "The optimist proclaims that we live in the best of all possible worlds. The pessimist fears this is true." Web: http://www.n0nb.us GPG key: D55A8819 GitHub: N0NB signature.asc Description: PGP signature ___ Dng mailing list Dng@lists.dyne.org https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng
Re: [DNG] new freedesktop "standard": /etc/machine-id
Hi Nate, Apologies for the belated follow-up. Nate Bargmann writes: > * On 2019 09 Mar 18:09 -0600, Olaf Meeuwissen wrote: >> All the info I have seen on this topic in the thread is consistent with >> hostid returning the "mangled" IP address belonging to the machine's >> current hostname. This is normally set from /etc/hostname. That file >> is created during installation. The IP address is in /etc/hosts. >> >> Taking 007f0100 as an example, swapping bytes in pairs gives 7f01 >> which gives 127.0.0.1. For 007f0101 you get 127.0.1.1. >> >> I just tried the following on my machine >> >> $ sudo hostname yoda # anything different from what you have now >> $ hostid # this is silent for a while and then says >> >> >> Presumably, DNS times out and then you get whatever the code used to >> initialize the return value. >> >> Trying to revert my change >> >> $ sudo hostname quark # this ponders things for a while and says >> sudo: unable to resolve host yoda >> $ hostid >> 007f0101 >> >> Please note that the hostname command does *not* modify the contents of >> /etc/hostname. To persist changes across reboots you'll need to edit >> /etc/hostname yourself. > > It looks like I have an exception: > > pi@aprxpi:~$ cat /etc/os-release > PRETTY_NAME="Raspbian GNU/Linux 8 (jessie)" > NAME="Raspbian GNU/Linux" > VERSION_ID="8" > VERSION="8 (jessie)" > ID=raspbian > ID_LIKE=debian > HOME_URL="http://www.raspbian.org/; > SUPPORT_URL="http://www.raspbian.org/RaspbianForums; > BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs; > pi@aprxpi:~$ ip address > 1: lo: mtu 65536 qdisc noqueue state UNKNOWN group > default qlen 1 > link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 > inet 127.0.0.1/8 scope host lo >valid_lft forever preferred_lft forever > inet6 ::1/128 scope host >valid_lft forever preferred_lft forever > 2: eth0: mtu 1500 qdisc pfifo_fast state UP > group default qlen 1000 > link/ether b8:27:eb:8b:f3:1c brd ff:ff:ff:ff:ff:ff > inet 192.168.25.61/24 brd 192.168.25.255 scope global eth0 >valid_lft forever preferred_lft forever > inet6 fd5d:beb2:2c86:0:ba27:ebff:fe8b:f31c/64 scope global mngtmpaddr > dynamic >valid_lft forever preferred_lft forever > inet6 2001:470:1f0f:9fa:ba27:ebff:fe8b:f31c/64 scope global mngtmpaddr > dynamic >valid_lft forever preferred_lft forever > inet6 fe80::ba27:ebff:fe8b:f31c/64 scope link >valid_lft forever preferred_lft forever > 4: ax0: mtu 512 qdisc pfifo_fast state UNKNOWN > group default qlen 10 > link/ax25 9c:60:9c:84:40:40:74 brd a2:a6:a8:40:40:40:00 > pi@aprxpi:~$ hostid > a8c03d19 > pi@aprxpi:~$ hostname > aprxpi.lan > pi@aprxpi:~$ cat /etc/hosts > 127.0.0.1 localhost > 127.0.1.1 aprxpi > pi@aprxpi:~$ ll /etc/host* > -rw-r--r-- 1 root root 9 Aug 7 2006 /etc/host.conf > -rw-r--r-- 1 root root 11 Mar 11 2018 /etc/hostname > -rw-r--r-- 1 root root 37 Jun 18 2018 /etc/hosts > -rw-r--r-- 1 root root 411 Mar 11 2016 /etc/hosts.allow > -rw-r--r-- 1 root root 711 Mar 11 2016 /etc/hosts.deny > > > On this particular machine the hostid is consistent with the IPv4 address of > eth0. I wrote "the IP address is in /etc/hosts", but I think that should have been "the IP address what your hostname resolves to" :-/ In many common scenarios that is likely to be the same as what is in your /etc/hosts file, but really depends on how name resolution is configured on your machine. Hope this helps, -- Olaf Meeuwissen, LPIC-2FSF Associate Member since 2004-01-27 GnuPG key: F84A2DD9/B3C0 2F47 EA19 64F4 9F13 F43E B8A4 A88A F84A 2DD9 Support Free Softwarehttps://my.fsf.org/donate Join the Free Software Foundation https://my.fsf.org/join ___ Dng mailing list Dng@lists.dyne.org https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng