I'm working on a script that is supposed to execute on startup, but the problem is that the script requires some files that are on a shared drive that is automatically mounted via fstab and at the time of it's execution the drive isn't mounted yet.
I've tried using cron @reboot and init.d route but they both execute too early. I also considered adding mount -a
to the script, but I would rather avoid having to sudo
it. For now I just added a delay to make it work, but that feels a bit hacky.
Is there a way to ensure that a startup script runs after fstab has been processed? Or force the mounts to be processed without using sudo
?
rc
scripts have not been a "route" for a long time on your operating system. The systemd version of this question has already been asked and answered here at https://unix.stackexchange.com/questions/246935/ . – JdeBP Jul 19 '18 at 15:38