WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: bootlocal.sh not executed on startup (from the command line it does)  (Read 5727 times)

Offline bhan

  • Newbie
  • *
  • Posts: 5
Hello,
I'm a fresh TinyCore user and I tried to mount a nfs share.
So I installed nfs-utils, added in /opt/bootlocal.sh the following lines:
mkdir /mnt/nfs
/usr/local/etc/init.d nfs-client start
mount -t nfs 10.0.0.125:/Download /mnt/nfs

Before rebooting created backup with the command filetoolsh -b
After rebooting, /mnt/nfs is empty.
After executing sudo /opt/bootlocal.sh
/mnt/nfs is mounted as expected.
Help, what's going wrong?? (syntax and configuration must be ok, timing problem? Dmesg doesn't help me any futher)
(now using coreplus-current32-5.4, version TinyCorePure64-6.4.1 neither mounted my drive)
Best Regards

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1702
Re: bootlocal.sh not executed on startup (from the command line it does)
« Reply #1 on: January 05, 2016, 02:30:33 PM »
Is this the exact entry?
Code: [Select]
/usr/local/etc/init.d nfs-client start
because it should be
Code: [Select]
/usr/local/etc/init.d/nfs-client start

Try booting with boot code  pause  to see if you get any error messages during bootlocal.sh.
Maybe  rpcbind  needs some time to start. If so you might add  sleep 1  before starting nfs-client.
Download a copy and keep it handy: Core book ;)

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11044
Re: bootlocal.sh not executed on startup (from the command line it does)
« Reply #2 on: January 05, 2016, 03:03:11 PM »
Your network is likely not yet up at that point - you'd need to wait for that before doing the mount. There are script snippets on this forum, search for ifconfig should find them.
The only barriers that can stop you are the ones you create yourself.

Offline bhan

  • Newbie
  • *
  • Posts: 5
Re: bootlocal.sh not executed on startup (from the command line it does)
« Reply #3 on: January 05, 2016, 04:40:12 PM »
Hello,
Indeed I forgot the / 
Adding the line below (before the mounting) didn't help
sleep=5
On this forum searching for ifconfig gave no result.
Best regards
« Last Edit: January 05, 2016, 05:02:34 PM by bhan »

Offline bhan

  • Newbie
  • *
  • Posts: 5
Re: bootlocal.sh not executed on startup (from the command line it does)
« Reply #4 on: January 05, 2016, 05:44:49 PM »
adding the line below  :)
/opt/bootsync.sh
in file /opt/bootlocal.sh before the nfs mount did the trick.
Thank you very much.
Just curious, why doesn't the command waitusb=5 or sleep=5 help? 

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1702
Re: bootlocal.sh not executed on startup (from the command line it does)
« Reply #5 on: January 05, 2016, 05:50:21 PM »
Try this, after ...
Code: [Select]
/opt/eth0.sh &
or however you start the network ...
Code: [Select]
SEC=60
while [ $SEC -gt 0 ]; do
ifconfig | grep -q "Bcast" && break || sleep 1
echo -ne "Waiting for IP... $((SEC--)) \r"
done
mkdir /mnt/nfs
/usr/local/etc/init.d/nfs-client start
mount -t nfs 10.0.0.125:/Download /mnt/nfs

BTW, you would use  sleep 5  without the equal sign ( = ).
Download a copy and keep it handy: Core book ;)

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1702
Re: bootlocal.sh not executed on startup (from the command line it does)
« Reply #6 on: January 05, 2016, 05:54:35 PM »
waitusb=5  is a boot code, which only affects the boot process before any extensions get loaded.
sleep  is a busybox command.

bootlocal.sh  is called by  bootsync.sh. Executing  bootsync.sh  from  bootlocal.sh  I would think creates an infinite loop.
Download a copy and keep it handy: Core book ;)

Offline bhan

  • Newbie
  • *
  • Posts: 5
Re: bootlocal.sh not executed on startup (from the command line it does)
« Reply #7 on: January 06, 2016, 04:03:22 AM »
Thank for the explanation.
I'm used to sles / ubuntu / centos.
Some things however are completely different in TinyCore so I have to learn the differences.
Mosf difficult part for me is diagnose/troubelshooting. but I'm going to invest time to learn it.
Best play to learn is this forum.