[LIVE] rc.local to automount a SMB share
#16
darn - I thought that was the answer to all my troubles... Oo

So to be clear, /etc/rc.local works perfectly when I sudo it from the command line.

Interestingly, when I reboot, rc.local must be functioning because I get "it works" in /tmp/test (I have tripled checked this).

But the drive stubbornly refuses to be mounted.
AFTV Stick 4K
AFTV (Gen 1)
Reply
#17
Did you put the "sleep 30 &&" before the smbmount command?

Sometimes that is needed to make sure that everything is initialized.

Jerry
Reply
#18
jawilljr Wrote:Did you put the "sleep 30 &&" before the smbmount command?

Sometimes that is needed to make sure that everything is initialized.

Jerry

Yes I did, no joy.

Good news though - increasing to 1000 worked! Big Grin

Thanks a million guys. I just hope this sticks...

By the way, what does the number represent - milliseconds, CPU cycles, or what? Really I'm interested to know how long I should wait after start time before double/triple/quadruple testing that it has worked.
AFTV Stick 4K
AFTV (Gen 1)
Reply
#19
If you use lucid, you can try upstart. I use it for etherwake, works good. No experience with mounts, try out and tel us.

Create a file /etc/init/mount.conf

Code:
description     "Wake up, my little friend"
author          "parti02"

start on started networking

exec /usr/sbin/ether-wake ...

Perhaps you must combine networking and filesystem.
start on (filesystem and started networkingl)

Gruß
Parti
Reply
#20
frumpy_uk Wrote:Yes I did, no joy.

Good news though - increasing to 1000 worked! Big Grin

Thanks a million guys. I just hope this sticks...

By the way, what does the number represent - milliseconds, CPU cycles, or what? Really I'm interested to know how long I should wait after start time before double/triple/quadruple testing that it has worked.

It is the number of seconds to wait before executing the next command... that is what the "&&" does it forces the smbmount to not executing for X seconds... try increasing that number to 40 or 50 or whatever works.

Jerry
Reply
#21
jawilljr Wrote:It is the number of seconds to wait before executing the next command... that is what the "&&" does it forces the smbmount to not executing for X seconds... try increasing that number to 40 or 50 or whatever works.

Jerry

thanks Jerry, good to know
AFTV Stick 4K
AFTV (Gen 1)
Reply
#22
I'd not use rc.local to mount external drive. If you see "network unreachable" in the first place, did you ever try to understand how/why it's being "reachable" afterward? Seems to me a system wide configuration problem. Where are you mounting the drive from - from a computer or off-the-shelf NAS drive? Is there anything in log - /var/log/messages? If you don't check the log for error messages and try to understand the underlying problem you maybe end up with wasting your time. Cheers!!!
MINIX NEO U22-XJ | Denon AVC-X3800H | KEF Q750 | KEF Q250c | KEF Q150 | KEF Q50a | KEF Kube 10 MIE | LG OLED65G16LA | CoreELEC
Reply
#23
MacUsers Wrote:I'd not use rc.local to mount external drive. If you see "network unreachable" in the first place, did you ever try to understand how/why it's being "reachable" afterward? Seems to me a system wide configuration problem. Where are you mounting the drive from - from a computer or off-the-shelf NAS drive? Is there anything in log - /var/log/messages? If you don't check the log for error messages and try to understand the underlying problem you maybe end up with wasting your time. Cheers!!!

I think the issue is just one of timing - there needed to be a delay before trying to mount the drive. This is now fixed by sleeping for 60 seconds prior to issuing the mount command from rc.local.

thanks
AFTV Stick 4K
AFTV (Gen 1)
Reply
#24
I mount my TimeCapsule drive from /etc/fstab and I never had a failed mount. I don't know what "delay before trying to mount the drive" you talking about but I think network is/should be reachable way before /etc/fstab kicks in. I run a full DHCP service in my network and the hostname (which comes from DHCP) is set at the beginning. Wondering if I'm missing anything. cheers!!
MINIX NEO U22-XJ | Denon AVC-X3800H | KEF Q750 | KEF Q250c | KEF Q150 | KEF Q50a | KEF Kube 10 MIE | LG OLED65G16LA | CoreELEC
Reply
#25
MacUsers Wrote:I mount my TimeCapsule drive from /etc/fstab and I never had a failed mount. I don't know what "delay before trying to mount the drive" you talking about but I think network is/should be reachable way before /etc/fstab kicks in. I run a full DHCP service in my network and the hostname (which comes from DHCP) is set at the beginning. Wondering if I'm missing anything. cheers!!

Glad to hear yours is working well. I don't know enough about Apple stuff (or indeed anything) to have an informed discussion on this I'm afraid. All I know is fstab always failed, as did rc.local, unless I had it pause for a minute before issuing the mount command. Assume this was because of networking delays.
AFTV Stick 4K
AFTV (Gen 1)
Reply
#26
What kind of network connection is this?
Reply
#27
Posh netgear gigabit router and QNAP NAS box.

All ethernet.

(I realise the aTV is 100Mb only by the way)
AFTV Stick 4K
AFTV (Gen 1)
Reply
#28
MacUsers Wrote:I mount my TimeCapsule drive from /etc/fstab and I never had a failed mount. I don't know what "delay before trying to mount the drive" you talking about but I think network is/should be reachable way before /etc/fstab kicks in. I run a full DHCP service in my network and the hostname (which comes from DHCP) is set at the beginning. Wondering if I'm missing anything. cheers!!

Different networking gear responds at different speeds. Apple products tend to be almost instant, whereas some older linksys stuff could take several minutes to assign an ip.
Reply

Logout Mark Read Team Forum Stats Members Help
[LIVE] rc.local to automount a SMB share0