Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Subject: Re: different mount table per bash session To: cygwin AT cygwin DOT com Cc: alan DOT miles AT ieee DOT org Message-ID: From: Alan DOT Miles AT firstdatacorp DOT com Date: Mon, 21 Apr 2003 10:20:25 -0500 MIME-Version: 1.0 Content-type: text/plain; charset=us-ascii Igor, It has been my experience that it does, unless I am issuing the mount commands from the wrong place - initially the mount commands were in the $HOME/.profile. Later I moved them into a script in /etc/profile.d. Should they be somewhere else? For example I created a mount point: /usr/a/ where I had a sub-directory of a network drive mounted on /usr/a/. I had a perl script running which accessed /usr/a/b/c/d/filexy.txt I also had another cygwin window where the CWD was in /usr/a/b/c/d/ and when I started a new cygwin window (** exactly ** the same mount points), the perl script malfunctioned, and temporarily lost my directory access in the other cygwin window. After everything stabilized, there was no problem. I successfully re-ran the perl script -- NO errors and the other window was fine. Maybe I still have the mount commands in the wrong place. IFAIK, they are fine. -------------------------------- Alan Miles |---------+----------------------------> | | Igor Pechtchanski| | | | | | | | | 04/21/2003 10:06 | | | AM | | | Please respond to| | | cygwin | | | | |---------+----------------------------> >------------------------------------------------------------------------------------------------------------------------------| | | | To: Alan DOT Miles AT firstdatacorp DOT com | | cc: cygwin AT cygwin DOT com, | | bcc: | | Subject: Re: different mount table per bash session | >------------------------------------------------------------------------------------------------------------------------------| Alan, If the location of the mount is the same, it doesn't matter how many times you re-mount it. Igor On Mon, 21 Apr 2003 Alan DOT Miles AT firstdatacorp DOT com wrote: > Igor, > > Granted. That is why I built this script to do the mount only ONCE for all > running instances. So when I start a second or subsequently cygwin session, > I do NOT attempt to mount again, thus affecting things globally - I ran > into that problem inadvertently without realising it. Once I caught on to > this, I came up with a method to store info in the Windows registry > regarding the number of running instances, but this approach was > problematic. That is when I came up with the below. > > I am using this method very successfully here at work and at home. I just > wanted to pass on my tip. > > -------------------------------- > Alan Miles > > |---------+----------------------------> > | | Igor Pechtchanski| > | | | | edu> | > | | | > | | 04/21/2003 08:54 | > | | AM | > | | Please respond to| > | | cygwin | > | | | > |---------+----------------------------> > >------------------------------------------------------------------------------------------------------------------------------| > | | > | To: Alan DOT Miles AT firstdatacorp DOT com | > | cc: cygwin AT cygwin DOT com, , | > | bcc: | > | Subject: Re: different mount table per bash session | > >------------------------------------------------------------------------------------------------------------------------------| > > > > > On Mon, 21 Apr 2003 Alan DOT Miles AT firstdatacorp DOT com wrote: > > > Saber, > > > > I had the same problem. > > > > >>hi there , > > > > >>I'm using cygwin bash to run many TCP/IP servers on the same host > > >>machine , i need each server to work with a separate drive , so each > > >> time i start a server the first thing i do is to mount automatically > > >> its corresponding drive , but the result is that the latest mounts > > > > >> suppress the previous one , so i have allways the same drive for all > > >> my servers. > > > > >> any help ? > > > > >> Best Regards. > > > > >>Saber. > > > > My solution uses the following saved as > > "/usr/bin/GetNumberRunningInstances" > > > > > > > > #!/bin/bash > > #The "/usr/bin/GetNumberRunningInstances" script > > > > let TheInstanceNumber="$(/usr/bin/ps -ef | /usr/bin/gawk -F ' ' ' BEGIN { > > TheCount = 0; } { if (($3 == 1) && ($6 == "/usr/bin/bash" )) then > > TheCount++;} END { print TheCount }')" > > > > > > /usr/bin/echo "${TheInstanceNumber}" > > > > # End-Of-Script. > > < End of Script> > > > > To use I then use a a file in /etc/profile.d/ > > > > containing the lines: > > > > let NewInstanceNumber="$(/usr/bin/GetNumberRunningInstances)" > > > > /usr/bin/echo "" > > /usr/bin/echo "NewInstanceNumber: '${NewInstanceNumber}'" > > /usr/bin/echo "" > > > > if [ ${NewInstanceNumber} -eq 1 ] > > then > > /usr/bin/echo " Mounting User Drives ..." > > /usr/bin/echo "" > > > > <> > > /usr/bin/echo "" > > /usr/bin/echo " Mounting User Drives ... continueing ..." > > else > > /usr/bin/echo "Not Re-Mounting User Drives - Already Mounted ... > > continueing ..." > > fi > > > > /usr/bin/echo "" > > > > That got around the problem for me. > > -------------------------------- > > Alan Miles > > Alan, > > FYI, once you change the mount table, you change it globally for all > running instances. > Igor -- http://cs.nyu.edu/~pechtcha/ |\ _,,,---,,_ pechtcha AT cs DOT nyu DOT edu ZZZzz /,`.-'`' -. ;-;;,_ igor AT watson DOT ibm DOT com |,4- ) )-,_. ,\ ( `'-' Igor Pechtchanski '---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow! Knowledge is an unending adventure at the edge of uncertainty. -- Leto II -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/