If-up.d/ scripts not working for all interfaces

Hi

I’m using OSMC from RC1, first using ethernet connection, next using USB wi-fi dongle configired through MyOSMC. Now I have updated to RC3 using manual update from MyOSMC.

I have simple test script in /etc/network/if-up.d/:

#!/bin/sh
echo `date`  >> /home/osmc/test
echo $METHOD >> /home/osmc/test
echo $IFACE >> /home/osmc/test

This is the output after reboot (WLAN working without any problems and up after reboot):

Fri May 22 20:23:34 CEST 2015
loopback
lo
Fri May 22 20:23:34 CEST 2015
none
--all

Can you post dmesg update?

I believe ifupdown is started by net.agent, independently of ConnMan, so this may be a udev issue.

Sam

[    0.000000] Booting Linux on physical CPU 0xf00
[    0.000000] Initializing cgroup subsys cpu
[    0.000000] Initializing cgroup subsys cpuacct
[    0.000000] Linux version 3.18.13-1-osmc (root@vero) (gcc version 4.9.2 (Debian 4.9.2-10) ) #1 SMP PREEMPT Sun May 17 18:50:26 UTC 2015
[    0.000000] CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=10c5387d
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] Machine model: Raspberry Pi 2 Model B
[    0.000000] cma: Reserved 8 MiB at 0x2e800000
[    0.000000] Memory policy: Data cache writealloc
[    0.000000] On node 0 totalpages: 192512
[    0.000000] free_area_init_node: node 0, pgdat 809abd80, node_mem_map ae213000
[    0.000000]   Normal zone: 1504 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
[    0.000000]   Normal zone: 192512 pages, LIFO batch:31
[    0.000000] [bcm2709_smp_init_cpus] enter (8640->f3003010)
[    0.000000] [bcm2709_smp_init_cpus] ncores=4
[    0.000000] PERCPU: Embedded 10 pages/cpu @ae1e1000 s12096 r8192 d20672 u40960
[    0.000000] pcpu-alloc: s12096 r8192 d20672 u40960 alloc=10*4096
[    0.000000] pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 191008
[    0.000000] Kernel command line: dma.dmachans=0x7f35 bcm2708_fb.fbwidth=1920 bcm2708_fb.fbheight=1080 bcm2709.boardrev=0xa01041 bcm2709.serial=0xad759f00 smsc95xx.macaddr=B8:27:EB:75:9F:00 bcm2708_fb.fbswap=1 bcm2709.disk_led_gpio=47 bcm2709.disk_led_active_low=0 sdhci-bcm2708.emmc_clock_freq=250000000 vc_mem.mem_base=0x3dc00000 vc_mem.mem_size=0x3f000000  root=/dev/mmcblk0p2 rootfstype=ext4 rootwait quiet osmcdev=rbp2
[    0.000000] PID hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
[    0.000000] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
[    0.000000] Memory: 744108K/770048K available (7249K kernel code, 401K rwdata, 1864K rodata, 388K init, 763K bss, 25940K reserved)
[    0.000000] Virtual kernel memory layout:
    vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap  : 0xffc00000 - 0xffe00000   (2048 kB)
    vmalloc : 0xaf800000 - 0xff000000   (1272 MB)
    lowmem  : 0x80000000 - 0xaf000000   ( 752 MB)
    modules : 0x7f000000 - 0x80000000   (  16 MB)
      .text : 0x80008000 - 0x808ee928   (9115 kB)
      .init : 0x808ef000 - 0x80950000   ( 388 kB)
      .data : 0x80950000 - 0x809b465c   ( 402 kB)
       .bss : 0x809b465c - 0x80a73594   ( 764 kB)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[    0.000000] Preemptible hierarchical RCU implementation.
[    0.000000] NR_IRQS:608
[    0.000000] Architected cp15 timer(s) running at 19.20MHz (virt).
[    0.000014] sched_clock: 56 bits at 19MHz, resolution 52ns, wraps every 3579139424256ns
[    0.000037] Switching to timer-based delay loop, resolution 52ns
[    0.000319] Console: colour dummy device 80x30
[    0.000522] console [tty0] enabled
[    0.000547] Calibrating delay loop (skipped), value calculated using timer frequency.. 38.40 BogoMIPS (lpj=192000)
[    0.000575] pid_max: default: 32768 minimum: 301
[    0.000963] Mount-cache hash table entries: 2048 (order: 1, 8192 bytes)
[    0.000985] Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes)
[    0.002220] Initializing cgroup subsys memory
[    0.002271] Initializing cgroup subsys devices
[    0.002295] Initializing cgroup subsys freezer
[    0.002318] Initializing cgroup subsys net_cls
[    0.002353] Initializing cgroup subsys blkio
[    0.002431] CPU: Testing write buffer coherency: ok
[    0.002508] ftrace: allocating 18151 entries in 54 pages
[    0.046771] CPU0: update cpu_capacity 1024
[    0.046810] CPU0: thread -1, cpu 0, socket 15, mpidr 80000f00
[    0.046829] [bcm2709_smp_prepare_cpus] enter
[    0.046968] Setting up static identity map for 0x6aeea8 - 0x6aef00
[    0.106712] [bcm2709_boot_secondary] cpu:1 started (0) 18
[    0.107019] CPU1: Booted secondary processor
[    0.107028] [bcm2709_secondary_init] enter cpu:1
[    0.107081] CPU1: update cpu_capacity 1024
[    0.107089] CPU1: thread -1, cpu 1, socket 15, mpidr 80000f01
[    0.126693] [bcm2709_boot_secondary] cpu:2 started (0) 18
[    0.126947] CPU2: Booted secondary processor
[    0.126953] [bcm2709_secondary_init] enter cpu:2
[    0.126986] CPU2: update cpu_capacity 1024
[    0.126994] CPU2: thread -1, cpu 2, socket 15, mpidr 80000f02
[    0.146716] [bcm2709_boot_secondary] cpu:3 started (0) 18
[    0.146952] CPU3: Booted secondary processor
[    0.146959] [bcm2709_secondary_init] enter cpu:3
[    0.146988] CPU3: update cpu_capacity 1024
[    0.146996] CPU3: thread -1, cpu 3, socket 15, mpidr 80000f03
[    0.147088] Brought up 4 CPUs
[    0.147122] SMP: Total of 4 processors activated (153.60 BogoMIPS).
[    0.147133] CPU: All CPU(s) started in SVC mode.
[    0.148137] devtmpfs: initialized
[    0.173080] VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 5
[    0.175124] pinctrl core: initialized pinctrl subsystem
[    0.178060] NET: Registered protocol family 16
[    0.183404] DMA: preallocated 4096 KiB pool for atomic coherent allocations
[    0.206530] cpuidle: using governor ladder
[    0.236554] cpuidle: using governor menu
[    0.236689] bcm2709.uart_clock = 3000000
[    0.239477] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers.
[    0.239498] hw-breakpoint: maximum watchpoint size is 8 bytes.
[    0.239530] mailbox: Broadcom VideoCore Mailbox driver
[    0.239644] bcm2708_vcio: mailbox at f300b880
[    0.239989] bcm_power: Broadcom power driver
[    0.240007] bcm_power_open() -> 0
[    0.240018] bcm_power_request(0, 8)
[    0.740682] bcm_mailbox_read -> 00000080, 0
[    0.740695] bcm_power_request -> 0
[    0.740815] Serial: AMBA PL011 UART driver
[    0.740944] dev:f1: ttyAMA0 at MMIO 0x3f201000 (irq = 83, base_baud = 0) is a PL011 rev3
[    0.809082] SCSI subsystem initialized
[    0.809329] usbcore: registered new interface driver usbfs
[    0.809432] usbcore: registered new interface driver hub
[    0.809583] usbcore: registered new device driver usb
[    0.811198] Switched to clocksource arch_sys_counter
[    0.838701] FS-Cache: Loaded
[    0.839021] CacheFiles: Loaded
[    0.850621] NET: Registered protocol family 2
[    0.851990] TCP established hash table entries: 8192 (order: 3, 32768 bytes)
[    0.852133] TCP bind hash table entries: 8192 (order: 4, 65536 bytes)
[    0.852326] TCP: Hash tables configured (established 8192 bind 8192)
[    0.852436] TCP: reno registered
[    0.852459] UDP hash table entries: 512 (order: 2, 16384 bytes)
[    0.852523] UDP-Lite hash table entries: 512 (order: 2, 16384 bytes)
[    0.852993] NET: Registered protocol family 1
[    0.853425] RPC: Registered named UNIX socket transport module.
[    0.853441] RPC: Registered udp transport module.
[    0.853451] RPC: Registered tcp transport module.
[    0.853462] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.853922] hw perfevents: enabled with armv7_cortex_a7 PMU driver, 5 counters available
[    0.854147] bcm2708_dma: DMA manager at f3007000
[    0.854308] vc-mem: phys_addr:0x00000000 mem_base=0x3dc00000 mem_size:0x3f000000(1008 MiB)
[    0.855917] futex hash table entries: 1024 (order: 4, 65536 bytes)
[    0.856133] audit: initializing netlink subsys (disabled)
[    0.856195] audit: type=2000 audit(0.829:1): initialized
[    0.872096] VFS: Disk quotas dquot_6.5.2
[    0.872471] Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[    0.875445] FS-Cache: Netfs 'nfs' registered for caching
[    0.876450] NFS: Registering the id_resolver key type
[    0.876521] Key type id_resolver registered
[    0.876533] Key type id_legacy registered
[    0.877562] msgmni has been set to 1469
[    0.879556] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 252)
[    0.879749] io scheduler noop registered
[    0.880055] io scheduler bfq registered (default)
[    0.880067] BFQ I/O-scheduler version: v7r7
[    0.882542] BCM2708FB: allocated DMA memory eec00000
[    0.882588] BCM2708FB: allocated DMA channel 0 @ f3007000
[    0.916251] Console: switching to colour frame buffer device 240x67
[    0.938445] bcm2708-dmaengine bcm2708-dmaengine: Load BCM2835 DMA engine driver
[    0.938762] uart-pl011 dev:f1: no DMA platform data
[    0.939241] vc-cma: Videocore CMA driver
[    0.939255] vc-cma: vc_cma_base      = 0x00000000
[    0.939268] vc-cma: vc_cma_size      = 0x00000000 (0 MiB)
[    0.939279] vc-cma: vc_cma_initial   = 0x00000000 (0 MiB)
[    0.950836] brd: module loaded
[    0.956777] loop: module loaded
[    0.957589] vchiq: vchiq_init_state: slot_zero = 0xaec80000, is_master = 0
[    0.958440] Loading iSCSI transport class v2.0-870.
[    0.959404] usbcore: registered new interface driver smsc95xx
[    0.959485] dwc_otg: version 3.00a 10-AUG-2012 (platform bus)
[    1.159852] Core Release: 2.80a
[    1.159875] Setting default values for core params
[    1.159903] Finished setting default values for core params
[    1.360296] Using Buffer DMA mode
[    1.360313] Periodic Transfer Interrupt Enhancement - disabled
[    1.360323] Multiprocessor Interrupt Enhancement - disabled
[    1.360336] OTG VER PARAM: 0, OTG VER FLAG: 0
[    1.360353] Dedicated Tx FIFOs mode
[    1.360714] WARN::dwc_otg_hcd_init:1047: FIQ DMA bounce buffers: virt = 0xaec14000 dma = 0xeec14000 len=9024
[    1.360754] FIQ FSM acceleration enabled for :
Non-periodic Split Transactions
Periodic Split Transactions
High-Speed Isochronous Endpoints
[    1.360779] dwc_otg: Microframe scheduler enabled
[    1.360850] WARN::hcd_init_fiq:412: FIQ on core 1 at 0x804f8c30
[    1.360870] WARN::hcd_init_fiq:413: FIQ ASM at 0x804f8fa0 length 36
[    1.360891] WARN::hcd_init_fiq:438: MPHI regs_base at 0xaf80a000
[    1.360918] dwc_otg bcm2708_usb: DWC OTG Controller
[    1.360969] dwc_otg bcm2708_usb: new USB bus registered, assigned bus number 1
[    1.361017] dwc_otg bcm2708_usb: irq 32, io mem 0x00000000
[    1.361072] Init: Port Power? op_state=1
[    1.361083] Init: Power Port (0)
[    1.361469] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[    1.361490] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    1.361506] usb usb1: Product: DWC OTG Controller
[    1.361522] usb usb1: Manufacturer: Linux 3.18.13-1-osmc dwc_otg_hcd
[    1.361537] usb usb1: SerialNumber: bcm2708_usb
[    1.362534] hub 1-0:1.0: USB hub found
[    1.362602] hub 1-0:1.0: 1 port detected
[    1.363131] dwc_otg: FIQ enabled
[    1.363145] dwc_otg: NAK holdoff enabled
[    1.363155] dwc_otg: FIQ split-transaction FSM enabled
[    1.363198] Module dwc_common_port init
[    1.363591] usbcore: registered new interface driver usb-storage
[    1.363879] mousedev: PS/2 mouse device common for all mice
[    1.364793] bcm2835-cpufreq: min=600000 max=1000000
[    1.365123] sdhci: Secure Digital Host Controller Interface driver
[    1.365136] sdhci: Copyright(c) Pierre Ossman
[    1.365326] DMA channels allocated for the MMC driver
[    1.401233] Load BCM2835 MMC driver
[    1.401539] sdhci-pltfm: SDHCI platform and OF driver helper
[    1.405413] ledtrig-cpu: registered to indicate activity on CPUs
[    1.407761] hidraw: raw HID events driver (C) Jiri Kosina
[    1.408089] usbcore: registered new interface driver usbhid
[    1.408101] usbhid: USB HID core driver
[    1.409481] TCP: cubic registered
[    1.409504] Initializing XFRM netlink socket
[    1.409555] NET: Registered protocol family 17
[    1.409833] Key type dns_resolver registered
[    1.410013] Registering SWP/SWPB emulation handler
[    1.413401] registered taskstats version 1
[    1.415846] vc-sm: Videocore shared memory driver
[    1.415867] [vc_sm_connected_init]: start
[    1.416759] [vc_sm_connected_init]: end - returning 0
[    1.417789] Waiting for root device /dev/mmcblk0p2...
[    1.438811] mmc0: host does not support reading read-only switch, assuming write-enable
[    1.440951] mmc0: new high speed SDHC card at address 1234
[    1.441618] mmcblk0: mmc0:1234 SA16G 14.6 GiB
[    1.443200]  mmcblk0: p1 p2
[    1.524027] EXT4-fs (mmcblk0p2): INFO: recovery required on readonly filesystem
[    1.524051] EXT4-fs (mmcblk0p2): write access will be enabled during recovery
[    1.561361] Indeed it is in host mode hprt0 = 00021501
[    1.741317] usb 1-1: new high-speed USB device number 2 using dwc_otg
[    1.741499] Indeed it is in host mode hprt0 = 00001101
[    1.941592] usb 1-1: New USB device found, idVendor=0424, idProduct=9514
[    1.941618] usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[    1.942642] hub 1-1:1.0: USB hub found
[    1.942747] hub 1-1:1.0: 5 ports detected
[    2.221337] usb 1-1.1: new high-speed USB device number 3 using dwc_otg
[    2.321541] usb 1-1.1: New USB device found, idVendor=0424, idProduct=ec00
[    2.321566] usb 1-1.1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[    2.324552] smsc95xx v1.0.4
[    2.385052] smsc95xx 1-1.1:1.0 eth0: register 'smsc95xx' at usb-bcm2708_usb-1.1, smsc95xx USB 2.0 Ethernet, b8:27:eb:75:9f:00
[    2.461327] usb 1-1.2: new low-speed USB device number 4 using dwc_otg
[    2.584211] usb 1-1.2: New USB device found, idVendor=09da, idProduct=024f
[    2.584237] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[    2.584253] usb 1-1.2: Product: RF USB Receiver
[    2.584268] usb 1-1.2: Manufacturer: A4Tech
[    2.598764] input: A4Tech RF USB Receiver as /devices/platform/bcm2708_usb/usb1/1-1/1-1.2/1-1.2:1.0/0003:09DA:024F.0001/input/input0
[    2.599132] hid-generic 0003:09DA:024F.0001: input,hidraw0: USB HID v1.11 Keyboard [A4Tech RF USB Receiver] on usb-bcm2708_usb-1.2/input0
[    2.620871] input: A4Tech RF USB Receiver as /devices/platform/bcm2708_usb/usb1/1-1/1-1.2/1-1.2:1.1/0003:09DA:024F.0002/input/input1
[    2.621614] hid-generic 0003:09DA:024F.0002: input,hidraw1: USB HID v1.11 Mouse [A4Tech RF USB Receiver] on usb-bcm2708_usb-1.2/input1
[    2.701325] usb 1-1.4: new high-speed USB device number 5 using dwc_otg
[    2.801970] usb 1-1.4: New USB device found, idVendor=0bda, idProduct=8179
[    2.801993] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    2.802010] usb 1-1.4: Product: 802.11n NIC
[    2.802026] usb 1-1.4: Manufacturer: Realtek
[    2.802041] usb 1-1.4: SerialNumber: 00E04C0001
[    5.593037] random: nonblocking pool is initialized
[   12.111320] EXT4-fs (mmcblk0p2): recovery complete
[   12.116769] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[   12.116852] VFS: Mounted root (ext4 filesystem) readonly on device 179:2.
[   12.122914] devtmpfs: mounted
[   12.123583] Freeing unused kernel memory: 388K (808ef000 - 80950000)
[   14.220015] NET: Registered protocol family 10
[   14.704538] systemd[1]: Cannot add dependency job for unit display-manager.service, ignoring: Unit display-manager.service failed to load: No such file or directory.
[   14.704924] systemd[1]: Found ordering cycle on basic.target/start
[   14.704956] systemd[1]: Found dependency on sysinit.target/start
[   14.704985] systemd[1]: Found dependency on kbd.service/start
[   14.705015] systemd[1]: Found dependency on remote-fs.target/start
[   14.705041] systemd[1]: Found dependency on remote-fs-pre.target/start
[   14.705066] systemd[1]: Found dependency on connman.service/start
[   14.705090] systemd[1]: Found dependency on basic.target/start
[   14.705117] systemd[1]: Breaking ordering cycle by deleting job kbd.service/start
[   14.705149] systemd[1]: Job kbd.service/start deleted to break ordering cycle starting with basic.target/start
[   14.917530] fuse init (API version 7.23)
[   15.042223] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
[   15.147090] systemd-udevd[115]: starting version 215
[   15.680916] r8188eu: module is from the staging directory, the quality is unknown, you have been warned.
[   15.705822] Chip Version Info: CHIP_8188E_Normal_Chip_TSMC_D_CUT_1T1R_RomVer(0)
[   15.743389] usbcore: registered new interface driver r8188eu
[   15.871354] FAT-fs (mmcblk0p1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
[   16.946245] Installing knfsd (copyright (C) 1996 okir@monad.swb.de).
[   17.870091] systemd-journald[93]: Received request to flush runtime journal from PID 1
[   18.775040] smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup
[   18.775237] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[   19.481633] MAC Address = 14:cc:20:1c:d8:9b
[   19.484137] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[   19.557125] cfg80211: Calling CRDA to update world regulatory domain
[   22.119656] R8188EU: ERROR assoc success
[   22.120118] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[   25.096422] Console: switching to colour dummy device 80x30

I am seeing exactly the same issue on a rPi2 which only has an Ethernet connection.

ifupdown is running before ConnMan according to journalctl. Echoing ifconfig in an if-up.d script indicates that only ‘lo’ is configured.

Personally, I am happy to update my ifupdown script into ConnMan if necessary but the documentation available is woeful.

Is is possible to setup an fwmark rule or default route to routing table in ConnMan?

Steve

Looks like ifupdown relies on an old legacy init.d script and needs updating for systemd [1]. We can update it to use systemd. Looks simple to update to systemd [2]. Then we can just add it to network-osmc and change ConnMan to start before ifup.

[1] Debian -- Error
[2] holgerschurig.de

Thank you.

Steve

So can you pls explain what must I do, do enable ifupdown through systemd? I tried creating 2 files mentioned in holgerschurig.de - /etc/systemd/system/ifupdown-clean.service and /etc/systemd/system/ifup@.service but that services does not have [Install] section. After adding manually it to multi-user.target.wants and configured to lauch after connman.service - nothing happened after reboot… (no info about ifup in journalctl)

Hi Sam,

Do you have any update on a likely timeframe for this fix please?

Thanks for your help.

Best Regards

Steve

I already have a patch for this but I am looking if we can get it upstreamed to ConnMan

Sam

Hi Sam,

OK, thanks very much for the update.

Best Regards

Steve