This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: running cygwin from file server


On Tue, 22 Aug 2006, Richard Foulk wrote:

> Aloha,
>
> I've installed Cygwin on a file server common to a large number of
> clients.  This allows various tools and scripts to be run on any
> of the clients without cluttering them with their own installations.
>
> Occasionally it would be nice to obtain a quick interactive shell
> environment on one of the clients, including having /tmp, /etc and
> others in place on the server partition.  Preferrably without leaving
> a lasting trace on the client.  Perhaps by invoking a single batch file
> from the server partition.
>
> Is there a quick, easy, or already done, way of doing this?

Something like this is quick, dirty, and ought to do it:

@echo off
set SCRIPT_DIR=%~dp0
REM Set up mounts
%SCRIPT_DIR%bin\mount -u "%SCRIPT_DIR%" /
%SCRIPT_DIR%bin\mount -u "%SCRIPT_DIR%bin" /usr/bin
%SCRIPT_DIR%bin\mount -u "%SCRIPT_DIR%lib" /usr/lib
REM Start the Cygwin shell
call %SCRIPT_DIR%cygwin.bat
REM Clean up mounts
%SCRIPT_DIR%bin\umount -uA

(put it in your Cygwin root on the file server, won't work on Win9x/ME).

Note that this will trash the user mounts in your existing Cygwin
environment on the client (if there is one).  Detecting existing Cygwin
user mounts using the mount command is left as an exercise for the reader.
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_	    pechtcha@cs.nyu.edu | igor@watson.ibm.com
ZZZzz /,`.-'`'    -.  ;-;;,_		Igor Peshansky, Ph.D. (name changed!)
     |,4-  ) )-,_. ,\ (  `'-'		old name: Igor Pechtchanski
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"Las! je suis sot... -Mais non, tu ne l'es pas, puisque tu t'en rends compte."
"But no -- you are no fool; you call yourself a fool, there's proof enough in
that!" -- Rostand, "Cyrano de Bergerac"

--
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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]