You are not logged in.

#1 2016-10-20 18:02:51

borisu
Member
Registered: 2016-10-20
Posts: 1

Running startup script fails to find network device

Hi,

I am trying to enable the batman protocol on virtual machine. For this to happen there some manipulations that should be done on network device, e.g. create bridged interface and add existing interface to the bridge.

I am using systemd facility to run the service on startup which will do the job. However the job fails consistently because it does not find the devices of network card.

- I have set the dependency in the best way I could - doesn't help.
- I have tried to work with eth1 or eth2 (according to dmesg they are beinf renamed to ensXXX somwhere in the boot proccess) - doesn't help

Any ideas???

[root@batman1 ~]# systemctl status ba
* ba.service - "batman-adv initializer"
   Loaded: loaded (/etc/systemd/system/ba.service; enabled; vendor preset: disab
   Active: inactive (dead) since Thu 2016-10-20 23:57:44 IDT; 12s ago
  Process: 243 ExecStart=/root/bat_conf (code=exited, status=0/SUCCESS)
Main PID: 243 (code=exited, status=0/SUCCESS)

Oct 20 23:57:44 batman1 systemd[1]: Started "batman-adv initializer".
Oct 20 23:57:44 batman1 bat_conf[243]: Cannot find device "ens38"
Oct 20 23:57:44 batman1 bat_conf[243]: Cannot find device "ens37"
Oct 20 23:57:44 batman1 bat_conf[243]: Error - interface does not exist: ens38
Oct 20 23:57:44 batman1 bat_conf[243]: Error - interface does not exist: ens37



[root@batman1 ~]# cat /etc/systemd/system/ba.service
[Unit]
Description="batman-adv initializer"
After=network.target dhcpcd.service sys-subsystem-net-device-ens37.device sys-subsystem-net-device-ens38.device

[Service]
ExecStart="/root/bat_conf"

[Install]
WantedBy=multi-user.target

[root@batman1 ~]# cat ~/bat_conf
#!/bin/sh
ip link set mtu 1532 dev ens38
ip link set mtu 1532 dev ens37
batctl if add ens38
batctl if add ens37


[root@batman1 ~]# ip link show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
    link/ether 00:0c:29:f3:4e:6b brd ff:ff:ff:ff:ff:ff
3: ens37: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
    link/ether 00:0c:29:f3:4e:75 brd ff:ff:ff:ff:ff:ff
4: ens38: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
    link/ether 00:0c:29:f3:4e:7f brd ff:ff:ff:ff:ff:ff

Last edited by borisu (2016-10-20 18:04:11)

Offline

Board footer

Powered by FluxBB