Re: Run script at boot time
- From: Loïc Grenié <loic.grenie@xxxxxxxxx>
- Date: Sun, 14 Nov 2010 10:41:20 +0100
2010/11/14 Shahar Dag <dag@xxxxxxxxxxxxxxxxx>:
"Loïc Grenié" <loic.grenie@xxxxxxxxx>
2010/11/14 Shahar Dag <dag@xxxxxxxxxxxxxxxxx>:Its a regular NFS filesystem mounted normally from /etc/fstab
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 ?
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@xxxxxxxxxxxxxxxx
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
- Follow-Ups:
- Re: Run script at boot time [ solved ]
- From: Shahar Dag
- Re: Run script at boot time [ solved ]
- References:
- Run script at boot time
- From: Shahar Dag
- Re: Run script at boot time
- From: Loïc Grenié
- Re: Run script at boot time
- From: Shahar Dag
- Run script at boot time
- Prev by Date: Re: Run script at boot time
- Next by Date: Re: Run script at boot time [ solved ]
- Previous by thread: Re: Run script at boot time
- Next by thread: Re: Run script at boot time [ solved ]
- Index(es):
Relevant Pages
|