On Tue, May 28, 2013 at 03:42:19PM +0200, Thomas Bächler wrote:
Am 25.05.2013 01:27, schrieb Gerardo Exequiel Pozzi:
On 05/24/2013 11:27 AM, Dave Reisner wrote:
On Fri, May 24, 2013 at 11:04:24AM -0300, Gerardo Exequiel Pozzi wrote:
Hello
I am planing to do a new release[#1] this weekend. Since we are using dhcpcd.service (dhcp for all net-if) and is racy, sometimes net-if rename work and others no. So I think can be a good idea to not rename at all.
Opinions?
Thanks.
[#1] Includes the change to move mkarchiso to /usr/bin. -- Gerardo Exequiel Pozzi \cos^2\alpha + \sin^2\alpha = 1
I tend to think this will make for a lousy user experience given that interface names will potentially change on the first boot of the newly installed system. Not really in favor of this.
Proposal: stop using dhcpcd.service, replace with a udev rule that launches instances of dhcpcd@.service for network devices as they appear:
# /etc/udev/rules.d/81-dhcpcd.rules ACTION=="add", SUBSYSTEM=="net", ENV{SYSTEMD_WANTS}="dhcpcd@$env{INTERFACE}.service"
This potentially breaks ordering for units on network.target, but we've never been able to guarantee that anyways using dhcpcd.service.
d
Ouch! It does not work :(
Looks like interface at this point is still named eth0, you can see on console at boot:
[ OK ] Started Entropy Harvesting Daemon. Starting Initializes Pacman keyring... [ OK ] Started Login Service. Expecting device sys-subsystem-net-devices-eth0.device... [ OK ] Found device /dev/ttyS0. Starting Serial Getty on ttyS0...
I think the INTERFACE environment variable is set before the rename. We can probably fix this - maybe try $name instead of $env{INTERFACE}?
Good call, this seems to work. Tested as follows on a VM: Added a rule to force a name change: # /etc/udev/rules.d/80-net-name-slot.rules SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="de:ad:be:ef:00:01", KERNEL=="eth*", NAME="lan0" And then the rule to add SYSTEMD_WANTS with Thomas's suggestion: # /etc/udev/rules.d/81-dhcpcd.rules ACTION=="add", SUBSYSTEM=="net", ENV{SYSTEMD_WANTS}="dhcpcd@$name.service" Reboot... # systemctl show dhcpcd@lan0 dhcpcd@lan0.service - dhcpcd on lan0 Loaded: loaded (/etc/systemd/system/dhcpcd@.service; disabled) Active: active (running) since Tue 2013-05-28 14:41:26 UTC; 2min 45s ago .... # ip -4 a s lan0 2: lan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000 inet 10.0.2.138/24 brd 10.0.2.255 scope global lan0 valid_lft forever preferred_lft forever