LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 04-29-2005, 08:19 PM   #1
egag
Senior Member
 
Registered: Jul 2004
Location: Netherlands
Distribution: Slackware
Posts: 2,721

Rep: Reputation: 53
strange thing with nfs


hoi all...

when i mount on pc A a nfs-share wich is on the disk of pc B,
and i shutdown pc B then i get the following :

-konquerer will not show the root-dir.
after a while i don't even get the filename of subdirs.
only
------
a
aa
b
bb
c
cc
etc......
-----

-ksysguard gives only "888888....etc" in the status bar, and no data on
running processes.
-i cannot unmount the share

i get kernel messages saying it's trying to mount and
in a console all is normal ( "ls / " and " top" work ok )

in the exports file on pc B there's only the (rw,sync) option.

rebooting pc B makes all normal again and then
i can unmount the share .

i think i have to change some setings somewhere , but
i can't find it.

any suggestions welcome .

egag
 
Old 04-29-2005, 08:22 PM   #2
AltF4
Member
 
Registered: Sep 2002
Location: .at
Distribution: SuSE, Knoppix
Posts: 532

Rep: Reputation: 31
mount the NFS directory with the "-o soft" option
 
Old 04-29-2005, 08:27 PM   #3
egag
Senior Member
 
Registered: Jul 2004
Location: Netherlands
Distribution: Slackware
Posts: 2,721

Original Poster
Rep: Reputation: 53
hmmm.....from " man mount "
---------
soft This option allows the kernel to time out if the nfs server is not
responding for some time. The time can be specified with timeo=time.
This option might be useful if your nfs server sometimes doesn't
respond or will be rebooted while some process tries to get a file
from the server. Usually it just causes lots of trouble.

---------

it sais it should work, but also causes " lot's of trouble ".

maybe there's more options...

egag
 
Old 04-30-2005, 08:09 AM   #4
egag
Senior Member
 
Registered: Jul 2004
Location: Netherlands
Distribution: Slackware
Posts: 2,721

Original Poster
Rep: Reputation: 53
well.....using the " soft " option makes it a little better.
switching to the root dir causes a timeout of a few minutes,
but it won't hang.

on pc A the mount command gives

-------
192.168.0.3:/home/packages on /diskhome type nfs (rw,soft,intr,addr=192.168.0.3)
-------

but it's only kde app.'s that are bothered; cli works ok.
so maybe i should set smth. in kde.....?

egag
 
Old 04-30-2005, 12:53 PM   #5
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
Try automount your nfs share, it is not too hard to set (your kernel has to be
configured with autofs though, preferably as module)

- installpkg autofs
- create a /etc/auto.master file with the content :
Code:
/net    /etc/auto.net
- create a /etc/auto.net file with the content :
Code:
packages     -fstype=nfs,rw,hard,intr    192.168.0.3:/home/packages
For some reason, there is no rc.autofs installed with the autofs package
so there is one :
http://mariner.cs.ucdavis.edu/slackw...ware/rc.autofs

save it as /etc/rc.d/rc.autofs
Then chmod +x it and /etc/rc.d/rc.autofs start, maybe add
' /etc/rc.d/rc.autofs start ' in rc.local

So try : konqueror /net/packages
 
Old 04-30-2005, 05:19 PM   #6
egag
Senior Member
 
Registered: Jul 2004
Location: Netherlands
Distribution: Slackware
Posts: 2,721

Original Poster
Rep: Reputation: 53
well....been trying for hours to get it working.
are you sure the script is ok ?
it won't run ok.......

maybe someone can explain this part:
---------
function getmounts()
{
# Check for local maps to be loaded
if [ -f /etc/auto.master ]
then
echo "echo "check"" #<---- added by me
cat /etc/auto.master | sed -e '/^#/d' -e '/^$/d'| (
while read dir map options
do
if [ ! -z "$dir" -a ! -z "$map" \
-a x`echo "$map" | cut -c1` != 'x-' ]
then
echo "echo "check1 "" #<added by me
etc.......
----------

this function is called as " getmounts | sh "

i added two checks.
the first one is echoed, the 2.nd one not.

and it's after this that the command " automount" is issued
so that's never run.

egag
 
Old 05-01-2005, 01:35 AM   #7
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
I have used this script for a long time, it works fine

I added your line to test at the same place in rc.autofs
"check1" was echoed 3 times when I did rc.autofs restart

Could you post auto.master and auto.* associed file ?
 
Old 05-01-2005, 02:05 AM   #8
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
Quote:
maybe someone can explain this part
Code:
 if [ ! -z "$dir" -a ! -z "$map" \
-a x`echo "$map" | cut -c1` != 'x-' ]
There are 3 expressions :
! -z "$dir" : $dir must not be empty
! -z "$map" : $map must not be empty

x`echo "$map" | cut -c1` != 'x-' : this one seems complicated but not really,
first let see what is between the ` ` chars : echo "$map" | cut -c1
so it takes the first char in $map variable if $map was equal to "-fs", then
x`echo "$map" | cut -c1` != 'x-'
becomes
x- != 'x-' : so the test return false
(basically, if the first char of $map contains '-', the last test returns false)

And finally the -a connective option stands for the 3 expressions must returns true
like : expression1 && expression2 && expression3
 
Old 05-01-2005, 07:44 AM   #9
egag
Senior Member
 
Registered: Jul 2004
Location: Netherlands
Distribution: Slackware
Posts: 2,721

Original Poster
Rep: Reputation: 53
thanks for the clear explanation.

i have these files :

/etc/auto.master

Code:
/net    /etc/auto.net  --timeout=60
/etc/auto.net

Code:
packages        -fstype=nfs,rw,hard,intr         192.168.0.3:/home/packages
a               -fstype=auto,rw,sync,umask=002  :/dev/fd0
d               -fstype=iso9660,ro,nosuid,nodev :/dev/cdrom
(i added cd & floppy also )

when running the script with these files, we should get

$dir = /net

and

$map =/etc/auto.net

and that should work then....but it doesn't.

any idea ?

egag
 
Old 05-01-2005, 10:44 AM   #10
egag
Senior Member
 
Registered: Jul 2004
Location: Netherlands
Distribution: Slackware
Posts: 2,721

Original Poster
Rep: Reputation: 53
well.....i got it.

in the file /etc/auto.master i needed to put a return at the end of the line
( just hit enter )

thanks for the help/explanation.

it works nice

egag
 
Old 05-01-2005, 10:46 AM   #11
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
I would remove --timeout in auto.master to see if it works but frankly
I have no idea why /etc/auto.master does not pass the first test in
getmounts() function :

Code:
echo "/net    /etc/auto.net  --timeout=60" |  (
         while read dir map options; do
             if [ ! -z "$dir" -a ! -z "$map" -a x`echo "$map" | cut -c1` != 'x-' ]; then
                 echo "test ok"
                 echo "dir: $dir"
                 echo "map: $map"
                 echo "options: $options"
             fi
         done)
-----------------------
test ok
dir: /net
map: /etc/auto.net
options: --timeout=60
That works as expected...

[edit]
I am glad you get it working
 
Old 05-01-2005, 10:51 AM   #12
egag
Senior Member
 
Registered: Jul 2004
Location: Netherlands
Distribution: Slackware
Posts: 2,721

Original Poster
Rep: Reputation: 53
i think it's rather a stupid mistake.
took me 6 hours and i got the script almost memorised

egag
 
Old 07-13-2005, 12:54 PM   #13
soyloquesoy
LQ Newbie
 
Registered: Jul 2005
Posts: 1

Rep: Reputation: 0
Question...

Do the /net and /net/packages
directories have to be created? Or are they created by the automount scripts?

I have tried to do this following your instructions (ie. without creating the directories) and I get the following error:
[root@machine1 /]# cd /net/packages
bash: cd: /net/packages: No such file or directory

Thanks!

M
 
Old 07-13-2005, 01:03 PM   #14
egag
Senior Member
 
Registered: Jul 2004
Location: Netherlands
Distribution: Slackware
Posts: 2,721

Original Poster
Rep: Reputation: 53
only /net; just use " #mkdir /net " to make it.


edit:erroredit

egag

Last edited by egag; 07-13-2005 at 01:05 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
strange thing in Licq - I'm offline for others Nad0xFF Linux - Software 0 04-16-2005 07:56 AM
a strange thing wizard7423 Slackware 3 03-17-2005 09:08 AM
A strange thing happened with ! lugoteehalt Programming 3 02-26-2004 04:59 AM
strange thing cristi1979 Linux - Security 4 07-11-2003 12:03 PM
Strange thing about pine Half_Elf Linux - Software 6 06-05-2003 01:52 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 08:00 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration