how to execute a script from NFS mount (which disconnected)?
Subsystems (2)
This question may sound silly, but I didn't find a proper solution to it.
I have a script on a NFS share. The purpose of this script is to do some network reconfiguration for Xen.
Unfortunately, it fails to execute somewhere in the middle.
Basically, the script brings the network interface down, does a bit of reconfiguring, and then, the interface is brought up.
In a short form, the script looks like that:
#!/bin/bash
echo Start
ifdown bond0
echo Step 1...
sleep 4s
echo Step 2...
sleep 4s
echo Step 3...
sleep 4s
echo Step 4...
sleep 4s
echo Step 5...
sleep 4s
ifup bond0
echo End
Unfortunately, when I execute it locally, the script freezes somewhere about step 2 or 3. Which I could perfectly understand - as the system can't read it.
But I did a "cat script" just before running it - so the system should have it cached, right?
Sometimes only, the script executes fully.
How can I execute a script from NSF mount - a script which reconfigures a network interface, and there is a period of network disconnection?
Signature · 11 lines
Tomasz Chmielewski http://wpkg.org ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ NFS maillist - [email protected] https://lists.sourceforge.net/lists/listinfo/nfs
Quoted 2 lines · Tomasz Chmielewski
How can I execute a script from NSF mount - a script which reconfigures a network interface, and there is a period of network disconnection?
Copy it to a RAMFS partition and execute it there.
Trond
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs
Quoted 5 lines · Trond Myklebust
Quoted 2 lines · Tomasz Chmielewski
How can I execute a script from NSF mount - a script which reconfigures a network interface, and there is a period of network disconnection?
Copy it to a RAMFS partition and execute it there.
No, that's not a good solution. Or a solution I would want to use.
I use the same script on systems having rootfs on iSCSI. And they also disconnect for a brief period of time.
There, everything works properly if I just "preload"/cache the script/programs with something like:
cat script &>/dev/null program --help &>/dev/null
Then, I can disconnect the station for several minutes, but the system will have the programs/scripts cached, and will be able to use them.
I would like to do something similar with NFS. Isn't there a "disconnected" mode for NSF (or "cached", etc.)?
Signature · 11 lines
Tomasz Chmielewski http://wpkg.org ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ NFS maillist - [email protected] https://lists.sourceforge.net/lists/listinfo/nfs
Quoted 17 lines · On Tue, 22 May 2007 14:17:49 +0200 Tomasz Chmielewski <[email protected]> wrote:
Quoted 5 lines · Trond Myklebust
Quoted 2 lines · Tomasz Chmielewski
How can I execute a script from NSF mount - a script which reconfigures a network interface, and there is a period of network disconnection?
Copy it to a RAMFS partition and execute it there.
No, that's not a good solution. Or a solution I would want to use.
I use the same script on systems having rootfs on iSCSI. And they also disconnect for a brief period of time.
There, everything works properly if I just "preload"/cache the script/programs with something like:cat script &>/dev/null program --help &>/dev/null
Quoted 7 lines
Then, I can disconnect the station for several minutes, but the system will have the programs/scripts cached, and will be able to use them.
I would like to do something similar with NFS. Isn't there a "disconnected" mode for NSF (or "cached", etc.)?
Nope. NFS will (likely) want to check the attributes on the file to make sure it's not changed before executing it. Copying it to a secondary location is what you'll want to do.
<idle speculation>
I wonder if you could do something like this on NFSv4 with delegations? </idle speculation>
Quoted 14 lines
Signature · 12 lines
-- Tomasz Chmielewski http://wpkg.org ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ NFS maillist - [email protected] https://lists.sourceforge.net/lists/listinfo/nfs
Signature · 10 lines
Jeff Layton <[email protected]> ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ NFS maillist - [email protected] https://lists.sourceforge.net/lists/listinfo/nfs
Quoted 28 lines · On Tue, 22 May 2007 08:25:54 -0400 Jeff Layton <[email protected]> wrote:
Quoted 17 lines · On Tue, 22 May 2007 14:17:49 +0200 Tomasz Chmielewski <[email protected]> wrote:
Quoted 5 lines · Trond Myklebust
Quoted 2 lines · Tomasz Chmielewski
How can I execute a script from NSF mount - a script which reconfigures a network interface, and there is a period of network disconnection?
Copy it to a RAMFS partition and execute it there.
No, that's not a good solution. Or a solution I would want to use.
I use the same script on systems having rootfs on iSCSI. And they also disconnect for a brief period of time.
There, everything works properly if I just "preload"/cache the script/programs with something like:cat script &>/dev/null program --help &>/dev/nullQuoted 7 lines
Then, I can disconnect the station for several minutes, but the system will have the programs/scripts cached, and will be able to use them.
I would like to do something similar with NFS. Isn't there a "disconnected" mode for NSF (or "cached", etc.)?
Quoted 8 lines
Nope. NFS will (likely) want to check the attributes on the file to make sure it's not changed before executing it. Copying it to a secondary location is what you'll want to do.
<idle speculation>
I wonder if you could do something like this on NFSv4 with delegations? </idle speculation>
If it's falling down in the middle of execution, however, the problem may be that the path or something is crossing onto an NFS mount, or it could be hanging on something like NIS. You may want to try stracing it to see what system call it's trying to execute when the hang occurs...
Quoted 28 lines
Quoted 14 lines
Signature · 12 lines
-- Tomasz Chmielewski http://wpkg.org ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ NFS maillist - [email protected] https://lists.sourceforge.net/lists/listinfo/nfsSignature · 10 lines
Jeff Layton <[email protected]> ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ NFS maillist - [email protected] https://lists.sourceforge.net/lists/listinfo/nfs
Signature · 10 lines
Jeff Layton <[email protected]> ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ NFS maillist - [email protected] https://lists.sourceforge.net/lists/listinfo/nfs
Quoted 17 lines · Tomasz Chmielewski
Quoted 5 lines · Trond Myklebust
Quoted 2 lines · Tomasz Chmielewski
How can I execute a script from NSF mount - a script which reconfigures a network interface, and there is a period of network disconnection?
Copy it to a RAMFS partition and execute it there.
No, that's not a good solution. Or a solution I would want to use.
I use the same script on systems having rootfs on iSCSI. And they also disconnect for a brief period of time.
There, everything works properly if I just "preload"/cache the script/programs with something like:cat script &>/dev/null program --help &>/dev/null
Quoted 6 lines
Then, I can disconnect the station for several minutes, but the system will have the programs/scripts cached, and will be able to use them.
I would like to do something similar with NFS. Isn't there a "disconnected" mode for NSF (or "cached", etc.)?
Feel free to write one. Otherwise, the only solution I can propose for you is the one I just mentioned.
Trond
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs
Quoted 9 lines · On Tuesday May 22, [email protected] wrote:
This question may sound silly, but I didn't find a proper solution to it.
I have a script on a NFS share. The purpose of this script is to do some network reconfiguration for Xen.
Unfortunately, it fails to execute somewhere in the middle.
Basically, the script brings the network interface down, does a bit of reconfiguring, and then, the interface is brought up.
...
Quoted 5 lines
Unfortunately, when I execute it locally, the script freezes somewhere about step 2 or 3. Which I could perfectly understand - as the system can't read it.
Not really. bash reads the whole script before executing it - or at least it did in my limited tests. strace would confirm.
My guess is that your $PATH includes a directory that is on the NFS mounted volume - so when bash looks for e.g. 'sleep', it looks on the NFS mounted volume and hangs.
Try running the script with "strace -f". It might be noisy, but it will show you what is blocking.
NeilBrown
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs