Created attachment 3177 [details] example-wrong-name-is-used-and-overrides-good.tar etcnet-0.9.7-alt0.M41.1 I have two profiles (default and "Yauza"). iftab is profiled, and gives to the Ethernet device two different names in the two profiles ("lan" and "yauza"). I want that each profile configures the iface with the corresponding name. (The config files are attached.) But unfortunately, if I'm switching from the default profile to "Yauza", the device has already the name "lan" and hence the wrong iface is configured and it "overrides" the intended correct configuration. This happens because ifup doesn't check if the name is invalid for the reason that the device should have another name, it only tries to rename any device to the wrong old name according to iftab, and if there is no such rule, everything is OK (but it is not!). Example run: [root@localhost net]# ip link 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 2: lan: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000 link/ether 00:13:a9:91:2a:52 brd ff:ff:ff:ff:ff:ff 3: wmaster0: <BROADCAST,MULTICAST> mtu 1500 qdisc ieee80211 qlen 1000 link/ieee802.11 00:19:d2:8b:85:51 brd ff:ff:ff:ff:ff:ff 4: wlan0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop qlen 1000 link/ether 00:19:d2:8b:85:51 brd ff:ff:ff:ff:ff:ff [root@localhost net]# service network startwith Yauza Computing interface groups: ... 3 interfaces found Starting group 0/virtual (1 interfaces) Starting lo: .....OK Starting group 1/realphys (2 interfaces) Starting lan: ..OK Starting yauza: .Error: cannot change name of lan to yauza: Device or resource busy .Cannot find device "yauza" xargs: /sbin/ip: exited with status 255; aborting Cannot find device "yauza" ...OK Processing /etc/net/vlantab: empty. [root@localhost net]# ifconfig lan Link encap:Ethernet HWaddr 00:13:A9:91:2A:52 inet addr:10.1.1.11 Bcast:10.1.1.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:225767 errors:0 dropped:0 overruns:0 frame:0 TX packets:130361 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:334350433 (318.8 MiB) TX bytes:7744961 (7.3 MiB) Interrupt:17 lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:0 (0.0 b) TX bytes:0 (0.0 b) [root@localhost net]# Expected: "yauza" is brought up, not "lan".
Created attachment 3178 [details] remove-wrong-name.patch The solution. It works -- tested both for bringing up yauza after lan, and lan after yauza: [root@localhost net]# ip link 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 2: lan: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000 link/ether 00:13:a9:91:2a:52 brd ff:ff:ff:ff:ff:ff 3: wmaster0: <BROADCAST,MULTICAST> mtu 1500 qdisc ieee80211 qlen 1000 link/ieee802.11 00:19:d2:8b:85:51 brd ff:ff:ff:ff:ff:ff 4: wlan0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop qlen 1000 link/ether 00:19:d2:8b:85:51 brd ff:ff:ff:ff:ff:ff [root@localhost net]# service network stop Computing interface groups: ... 3 interfaces found Processing /etc/net/vlantab: empty. Stopping group 1/realphys (2 interfaces) Stopping lan: ....OK Stopping yauza: OK Stopping group 0/virtual (1 interfaces) Stopping lo: .OK [root@localhost net]# git merge program-wrong-name-removed Merge made by recursive. scripts/ifup | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) [root@localhost net]# service network startwith Yauza Computing interface groups: ... 3 interfaces found Starting group 0/virtual (1 interfaces) Starting lo: ......OK Starting group 1/realphys (2 interfaces) Starting lan: .yauza %.OK Starting yauza: .yauza %........OK Processing /etc/net/vlantab: empty. [root@localhost net]# ifconfig lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:0 (0.0 b) TX bytes:0 (0.0 b) yauza Link encap:Ethernet HWaddr 00:00:39:35:C1:3B inet addr:172.19.36.109 Bcast:172.19.37.255 Mask:255.255.254.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:225969 errors:0 dropped:0 overruns:0 frame:0 TX packets:130585 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:334468754 (318.9 MiB) TX bytes:7822657 (7.4 MiB) Interrupt:17 [root@localhost net]# service network stop Computing interface groups: ... 3 interfaces found Processing /etc/net/vlantab: empty. Stopping group 1/realphys (2 interfaces) Stopping lan: OK Stopping yauza: ...OK Stopping group 0/virtual (1 interfaces) Stopping lo: .OK [root@localhost net]# service network start Computing interface groups: ... 3 interfaces found Starting group 0/virtual (1 interfaces) Starting lo: ......OK Starting group 1/realphys (2 interfaces) Starting lan: ...OK Starting yauza: ...Cannot find device "yauza" xargs: /sbin/ip: exited with status 255; aborting Cannot find device "yauza" ...OK Processing /etc/net/vlantab: empty. [root@localhost net]# ifconfig lan Link encap:Ethernet HWaddr 00:00:39:35:C1:3B inet addr:10.1.1.30 Bcast:10.1.1.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:225975 errors:0 dropped:0 overruns:0 frame:0 TX packets:130600 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:334469599 (318.9 MiB) TX bytes:7824537 (7.4 MiB) Interrupt:17 lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:3 errors:0 dropped:0 overruns:0 frame:0 TX packets:3 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:285 (285.0 b) TX bytes:285 (285.0 b) [root@localhost net]#
(In reply to comment #1) > Created an attachment (id=3178) [details] > remove-wrong-name.patch > > The solution. One thing that was not quite clear to me: it shouldn't be an error if a name was successfully removed because it doesn't yet mean that everything went wrong: on the next step, another device might still get the requested name.
I will be able to review around mid-March.
В 4.1/branch исправления не будут вноситься уже технически (заглушена очередь на сборку), поэтому прошу ошибки, актуальные для sisyphus/p7/t7, перевесить на текущие ветки или сизиф.