Thanks. Unfortunately, that link doesn’t help. But your comment about VB daemon not being started yet is probably the issue. Can I schedule a script to run as root 1 minute after startup that does the mounting?
> hendersj;2511864 Wrote:
>> On Wed, 19 Dec 2012 02:06:02 +0000, 6tr6tr wrote:
>>
>> > then it mounts it! Why isn’t fstab auto-mounting the folder?
>>
>> At a guess, at startup, the VirtualBox daemon hasn’t started before the
>> filesystems try to mount the way you’re doing it.
>>
>> Check out:
>>
>> ‘Chapter’ (http://www.virtualbox.org/manual/ch04.html#sf_mount_auto)
>>
>> See if that gets you pointed in the right direction.
>>
>> Jim
>>
>>
> Thanks. Unfortunately, that link doesn’t help. But your comment about VB
> daemon not being started yet is probably the issue. Can I schedule a
> script to run as root 1 minute after startup that does the mounting?
You could try using a cron job scheduled for @reboot - or the after.local
script would seem to be a good place to set it up.
On 12/19/2012 12:59 AM, Jim Henderson wrote:
> On Wed, 19 Dec 2012 06:26:02 +0000, 6tr6tr wrote:
>
>> hendersj;2511864 Wrote:
>>> On Wed, 19 Dec 2012 02:06:02 +0000, 6tr6tr wrote:
>>>
>>>> then it mounts it! Why isn’t fstab auto-mounting the folder?
>>>
>>> At a guess, at startup, the VirtualBox daemon hasn’t started before the
>>> filesystems try to mount the way you’re doing it.
>>>
>>> Check out:
>>>
>>> ‘Chapter’ (http://www.virtualbox.org/manual/ch04.html#sf_mount_auto)
>>>
>>> See if that gets you pointed in the right direction.
>>>
>>> Jim
>>>
>>>
>> Thanks. Unfortunately, that link doesn’t help. But your comment about VB
>> daemon not being started yet is probably the issue. Can I schedule a
>> script to run as root 1 minute after startup that does the mounting?
>
> You could try using a cron job scheduled for @reboot - or the after.local
> script would seem to be a good place to set it up.
You need to be aware that after.local scripts are not run automatically with
systemd as the concept of “after” is no longer valid. You also need to create
the service to do that, and you cannot be sure that it is started after any
particular event.
A much simpler approach would be to create a script to be run in the background
from boot.local with the command ‘/path_to_my_script/script_name &’. The script
would do a ‘sleep 60’ followed by the appropriate mount command.
On Wed, 19 Dec 2012 15:59:24 +0000, Larry Finger wrote:
> You need to be aware that after.local scripts are not run automatically
> with systemd as the concept of “after” is no longer valid. You also need
> to create the service to do that, and you cannot be sure that it is
> started after any particular event.
>
> A much simpler approach would be to create a script to be run in the
> background from boot.local with the command
> ‘/path_to_my_script/script_name &’. The script would do a ‘sleep 60’
> followed by the appropriate mount command.
Good point, thanks, Larry - I’d forgotten that that wasn’t relevant with
systemd.
On Wed, 19 Dec 2012 10:18:09 +0000, Carlos E. R. wrote:
> On 2012-12-19 07:59, Jim Henderson wrote:
>
>>> Can I schedule a script to run as root 1 minute after startup that
>>> does the mounting?
>>
>> You could try using a cron job scheduled for @reboot
>
> And there you can schedule an “at” job to run a minute later. Result:
> job runs a minute after reboot, as requested
Thanks! Can you tell me how I would do this? I’ve found some info on cron jobs but can’t seem to figure out how to schedule my script for a minute after startup. Also, how do I make the script run its commands as root?
The first thing is learning if the script runs. For that, you set it to
run in 3 minutes time, not at boot. And instead of mounting something,
you set the script to write a line to a file. And then you watch the
messages log, and if you see the cron entry there, also the file that it
is supposed to write to.
If that works, then you do the mounting.
You can also do the 1 minute delay inside the script.
Ah! In crob jobs entries, use full paths.
And, if you have local mail working, you place a line
MAILTO=myusername
in the crontab file and you will get a nice email with the errors.
–
Cheers / Saludos,
Carlos E. R.
(from 11.4, with Evergreen, x86_64 “Celadon” (Minas Tirith))