Click to See Complete Forum and Search --> : Start up script, network share mount issue


firebird
01-04-2012, 09:01 PM
I have a startup script at runlevel 2 (rc2.d) that starts nodejs on a network share. The script depends on $network, $remote_fs, $local_fs, $all.

The mount entry is in fstab and is a windows share.

start_node(){
dir >> /home/log
mount -a
/usr/local/bin//node /mnt/web/app.js &
}

The dir and mount lines are for debugging.

When the script starts up, nodejs complains that it can't find app.js. However, the dir line that runs before it shows that the file is there.

When I added the mount -a line, cifs throw an error saying the network is unreachable. How can dir log the directory contents while mount -a says the network is unreachable?

After everything loads and I login as root, if I do mount -a, everything works fine. If I run the script at that point, it works fine.

How do I resolve this?

x
01-06-2012, 04:56 AM
"How can dir log the directory contents while mount -a says the network is unreachable?"
Sometimes network resources are kinda "cached" - I think it depends on mounting options but I'm definitely not sure, it has happened to me a few years ago but I never checked the reason.

Since you get an error "network unreachable" my first guess is that network isn't completely up.
For more help, please post output of "ls-l /etc/rc2.d" (or wherever your rc2.d resides).
Also add a line in your script to log ipaddress, like "ifconfig > /root/ipadress"