That worked!
Thanks!
That worked!
Thanks!
It did not work.
I think, I identified the problem, I lack sufficient understanding how system.d works.
Below is the same info as in my last post.
But never mind, I will try to figure it out from here and may come back when I really get stuck.
Thanks again mglae and chewitt,
Thomas
kodipi:~ # cat .config/system.d/wait-for-server.service
[Unit]
Description=Wait for server
After=time-sync.target
[Service]
Type=oneshot
#ExecStart=/bin/sh -c "until ping -c 1 -W 3 192.168.50.12;do sleep 1;done"
ExecStart=/bin/sh -c "until nc -z 192.168.50.12 139;do sleep 1;done"
StandardOutput=null
#StandardError=null
RemainAfterExit=yes
kodipi:~ #
kodipi:~ # cat .config/system.d/storage-media_storage_1.mount
# This is a service script to mount CIFS/SAMBA shares like Apple Timecapsule.
[Unit]
Description= timecapsule mount script for media_storage_1
#Requires=network-online.service
#After=network-online.service
#After=time-sync.target
Requires=wait-for-server.service
After=wait-for-server.service
Before=kodi.service
[Mount]
What=//192.168.50.12/Data
Where=/storage/media_storage_1
Options=user=root,password=discovery71,sec=ntlm,vers=1.0
Type=cifs
[Install]
WantedBy=multi-user.target
kodipi:~ #
Display More
Thanks for your suggestions, but it did not work, the timecapsule was not mounted.
Here is a link to my pastekodi: http://ix.io/3y67
Output of arp -a
kodipi:~ # arp -a
media-storage-1.B47Homenet (192.168.50.12) at 00:24:36:a4:31:9a [ether] on eth0
? (192.168.50.213) at 04:d9:f5:29:b0:b0 [ether] on eth0
Thomass-iMac.B47Homenet (192.168.50.3) at 3c:07:54:34:2a:6b [ether] on eth0
RT-AX92U-ADE0.B47Homenet (192.168.50.1) at 04:d9:f5:29:ad:e0 [ether] on eth0
kodipi:~ #
These are the two system.d files according to your instructions:
storage-media_storage_1.mount
[Unit]
Description= timecapsule mount script for media_storage_1
Requires=wait-for-server.service
After=wait-for-server.service
Before=kodi.service
[Mount]
What=//192.168.50.12/Data
Where=/storage/media_storage_1
Options=user=root,password=discovery71,sec=ntlm,vers=1.0
Type=cifs
[Install]
WantedBy=multi-user.target
Display More
wait-for-server.service
[Unit]
Description=Wait for server
After=time-sync.target
[Service]
Type=oneshot
ExecStart=/bin/sh -c "until ping -c 1 -W 3 192.168.50.12;do sleep 1;done"
StandardOutput=null
#StandardError=null
RemainAfterExit=yes
When I reboot just the pi, leaving the Timecapsule on, it works.
So, somehow, system.d is not waiting for the TC to be available before running the mount scirpt.
(BTW, I removed the second TC to simplify for the time being.)
QuoteDisplay Morekodipi:~ # arp -a
Thomass-iMac.B47Homenet (192.168.50.3) at 3c:07:54:34:2a:6b [ether] on eth0
media-storage-2.B47Homenet (192.168.50.13) at 70:73:cb:b4:93:e0 [ether] on eth0
media-storage-1.B47Homenet (192.168.50.12) at 00:24:36:a4:31:9a [ether] on eth0
RT-AX92U-ADE0.B47Homenet (192.168.50.1) at 04:d9:f5:29:ad:e0 [ether] on eth0
kodipi:~ #
Both Timecapsules are online, but Kodi boots so fast, the TCs are not ready when the mounting script runs.
Is there a possibility to delay the mounting process until the TCs have been successfully pinged?
Ok, i tried my first pastekodi and got:
kodipi:~ # pastekodi
error=1 error_msg="Command not registered"
Use 'vcgencmd commands' to get a list of commands
http://ix.io/3xEM
kodipi:~ #
This is the link it created: http://ix.io/3xEM
I tried the following, but it failed.
The path for the file below is: ~/.config/system.d/storage-media_storage_1.mount
# This is a service script to mount CIFS/SAMBA shares like Apple Timecapsule.
[Unit]
Description= timecapsule mount script for media_storage_1
Requires=network-online.service
After=time-sync.target
Before=kodi.service
[Mount]
What=//192.168.50.12/Data
Where=/storage/media_storage_1
Options=user=root,password=MY_SECRET_PASSWORD,sec=ntlm,vers=1.0
Type=cifs
[Install]
WantedBy=multi-user.target
Display More
After turning on the Raspberry Pi and the Timecapsule I ran systemctl status storage-media_storage_1.mount
and got the following output:
● storage-media_storage_1.mount - timecapsule mount script for media_storage_1
Loaded: loaded (/storage/.config/system.d/storage-media_storage_1.mount; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Tue 2021-08-31 11:08:37 CEST; 1min 15s ago
Where: /storage/media_storage_1
What: //192.168.50.12/Data
Aug 31 11:08:31 kodipi systemd[1]: Mounting timecapsule mount script for media_storage_1...
Aug 31 11:08:37 kodipi mount[366]: mount: mounting //192.168.50.12/Data on /storage/media_storage_1 failed: No route to host
Aug 31 11:08:37 kodipi systemd[1]: storage-media_storage_1.mount: Mount process exited, code=exited, status=255/EXCEPTION
Aug 31 11:08:37 kodipi systemd[1]: storage-media_storage_1.mount: Failed with result 'exit-code'.
Aug 31 11:08:37 kodipi systemd[1]: Failed to mount timecapsule mount script for media_storage_1.
~
Display More
Any idea, what to try next?
Thanks,
Thomas
Thanks mglae. In the meantime I broke the whole system, so I am not able to test your solution. I will let you know, when I managed to fix it.
Hi everyone,
I am using chewitt's solution below on a RPI 3 with an old Apple Timecapsule. It works well when i first turn on the Timecapsule and wait until it is visible (pingable) on my LAN and then turn on the PI. But when I turn on everything at the same time, the Timecapsule does not get mounted, because Libreelect boots so fast. Is there a way to include a check for network availability of the Timecapsule in the mounting scrit below?
Thanks,
Thomas
Code Display More[Unit] Description=TimeCapsule Mount Script Requires=network-online.service After=network-online.service Before=kodi.service [Mount] What=//192.168.1.10/data Where=/storage/data Options=username=plez,password=crash,sec=ntlm,vers=1.0 Type=cifs [Install] WantedBy=multi-user.target
^ You are missing the [install] section .. so a copy/paste error as predicted