delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/04/21/09:55:10

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
X-Authentication-Warning: slinky.cs.nyu.edu: pechtcha owned process doing -bs
Date: Mon, 21 Apr 2003 09:54:03 -0400 (EDT)
From: Igor Pechtchanski <pechtcha AT cs DOT nyu DOT edu>
Reply-To: cygwin AT cygwin DOT com
To: Alan DOT Miles AT firstdatacorp DOT com
cc: cygwin AT cygwin DOT com, <saber DOT zrelli AT st DOT com>, <alan DOT miles AT ieee DOT org>
Subject: Re: different mount table per bash session
In-Reply-To: <OFF7DC63AD.7E240D07-ON86256D0F.00498708@firstdatacorp.com>
Message-ID: <Pine.GSO.4.44.0304210953010.19398-100000@slinky.cs.nyu.edu>
Importance: Normal
MIME-Version: 1.0

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"
>
>
> <Start Of Script>
> #!/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 "<Start>    Mounting User Drives ..."
>    /usr/bin/echo ""
>
>    <<mount drives>>
>    /usr/bin/echo ""
>    /usr/bin/echo "<Finished> 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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019