Run script at boot time [ solved ]
Shahar Dag
dag at cs.technion.ac.il
Sun Nov 14 13:04:06 UTC 2010
----- Original Message -----
From: "Loïc Grenié" <loic.grenie at gmail.com>
To: "Shahar Dag" <dag at cs.technion.ac.il>; "Ubuntu user technical support,not
for general discussions" <ubuntu-users at lists.ubuntu.com>
Sent: Sunday, November 14, 2010 11:41 AM
Subject: Re: Run script at boot time
2010/11/14 Shahar Dag <dag at cs.technion.ac.il>:
> "Loïc Grenié" <loic.grenie at gmail.com>
>> 2010/11/14 Shahar Dag <dag at cs.technion.ac.il>:
>>> Hello
>>>
>>>
>>>
>>> On Ubuntu 8.04 I want to run a script that update some files.
>>>
>>> I want to run the script when the computer boots.
>>>
>>> The script takes the data from a mounted file system (it’s a network
>>> file
>>> system).
>>>
>>>
>>>
>>> The script is started by an entry in /etc/crontab that looks like:
>>>
>>> @reboot root my_script
>>>
>>> The problem is that the file system is not mounted when my_script is
>>> called.
>>
>> /etc/rc.local is one of the last script to be called at boot. All
>> NFS filesystems
>> should be mounted at that point. Are your NFS flesystems in /etc/fstab
>> and
>> mounted "normally" by the system or are there mounted by some custom
>> way ?
>>
> Its a regular NFS filesystem mounted normally from /etc/fstab
As suggested by Nils Kassube, you can wait for the data to be present
to finish your script:
while ! -f /mnt/nfs/<whatever>
do
sleep 60
done
It won't make your boot longer:
1) If you can finish your boot with your NFS partition not mounted (and
your
script waiting) launch your script in background in /etc/rc.local.
2) It you cannot finish your with your NFS partition not mounted, then
your
script will wait and be launched afterward, but what else can you do ? You
can lower the sleep to sleep 1 if you want faster action.
Hope this helps,
Loïc
--
ubuntu-users mailing list
ubuntu-users at lists.ubuntu.com
Modify settings or unsubscribe at:
https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Thanks
The while loop did the trick
I can't see any chnage in boot time
Shahar
More information about the ubuntu-users
mailing list