SMB share not mounting on boot, but can be mount manually

I can’t get Coreelec to automount my smb shares, this is the output from
systemctl status storage-movies.mount

â storage-movies.mount - cifs mount script
     Loaded: loaded (/storage/.config/system.d/storage-movies.mount; enabled; vendor preset: disabled)
     Active: failed (Result: exit-code) since Sun 2022-06-26 21:54:51 EEST; 39s ago
      Where: /storage/movies
       What: //10.10.1.100/D3_8TB_MOVIES

Aug 06 17:43:13 Kodi systemd[1]: Mounting cifs mount script...
Jun 26 21:54:51 Kodi mount[3369]: mount: mounting //10.10.1.100/D3_8TB_MOVIES on /storage/movies failed: Operation now in progress
Jun 26 21:54:51 Kodi systemd[1]: storage-movies.mount: Mount process exited, code=exited, status=255/EXCEPTION
Jun 26 21:54:51 Kodi systemd[1]: storage-movies.mount: Failed with result 'exit-code'.
Jun 26 21:54:51 Kodi systemd[1]: Failed to mount cifs mount script.

But if I try manually with systemctl start storage-movies.mount it mount and status is this

â storage-movies.mount - cifs mount script
     Loaded: loaded (/storage/.config/system.d/storage-movies.mount; enabled; vendor preset: disabled)
     Active: active (mounted) since Sun 2022-06-26 21:59:47 EEST; 18s ago
      Where: /storage/movies
       What: //10.10.1.100/D3_8TB_MOVIES
      Tasks: 0 (limit: 1757)
     Memory: 56.0K
     CGroup: /system.slice/storage-movies.mount

Jun 26 21:59:47 Kodi systemd[1]: Mounting cifs mount script...
Jun 26 21:59:47 Kodi systemd[1]: Mounted cifs mount script.

Any ideas?

According to an answer I found on stackexchange, this is caused by incorrect route.

Your IP seems wierd, are you using 10.0.0.0/8 or 10.10.1.0/24 as your subnet? The error could be caused by wrong route being set during network setup. I guess CE is using 10.0.0.0/8 as its subnet initialy then switched to 10.10.1.0/24 after it found the network does not work. But by then the .mount unit already failed. As a workaround you can add an command in custom.sh to manually restart the mount unit after some delay

Thanks for the answer

CE is on another VLAN with a static IP (10.10.20.30, the server is on .1.100) so it shouldn’t be a problem. You meantioned custom.sh, what is it?

Since I wrote this I tried .config/autostart.sh without any delay (systemctl start storage-movies.mount) and it mounts so I don’t think it is a routing problem…

try something like:

Requires=network-online.service
After=network-online.service
Before=kodi.service

in your service and enable in kodi “wait for network” option

Thx, but I already have that and a wait for max 30 seconds in “Wait for network”