This is the mail archive of the cygwin@cygwin.com 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: rollback procedure, was: what determines cygwin path?


Please honor the Reply-To: -- that's what it's there for.

On Fri, 25 Apr 2003, Qwer Zxcv wrote:

> Qwer Zxcv wrote:
> >>>> So what I'd like to know is, how is cygwin's path determined?
> >>>> (Apparently not entirely by the windows path, at least not by
> >>>> default.) And how do I fix it?
>
> Max Bowsher wrote:
> >>> Windows + /etc/profile + any user customisation.
>
> Max Bowsher wrote (later):
> >> Anything you yourself have deliberately changed - e.g. ~/.profile,
> >> ~/.bash_profile, etc.
>
> OK, so to enable successful rollback, I should be sure to keep these
> in a home directory out of the cygwin tree, correct? I'm presuming
> setup.exe is not going to try to read or write them.

I believe one of the postinstall scripts copied the default versions of
the initialization files (e.g., .bash_profile) to your home directory if
they weren't present there.  You may have to also run "mkpasswd -d" and/or
"mkgroup -d" if you are a domain user -- this sort of think didn't use to
happen by default (it may now).

> Also:
>
> Igor Pechtchanski wrote:
> > The "mount.exe" program will run even if the mounts are all gone (as
> > long as it's invoked via an absolute path or from the current
> > directory and cygwin1.dll is in the same directory).
>
> > It's been stated time and time again on this list that going to the
> > registry is an unsafe and nonportable way of manipulating the mount
> > table.
>
> OK, but please keep in mind that (I suspect) lots of folks only read
> this list when they're having problems :-)

FWIW, the first step should have been *searching* the list (either using
the archive search function, or google).

> > Especially when mount.exe does a very adequate job. There already
> > are plans (and code, AFAIK, though not in the production system) to
> > store the mount table in a file instead of in the registry. Please
> > manipulate the mount table only by using mount.exe (or setup.exe).
>
> Will do. I even learned what Max meant by 'mount -m' :-)
>
> So, to ensure roll-back-ability, one should:
>
> *** As part of good cygwin hygeine:
>
> * Create/use a home directory outside the cygwin install tree.
>
> * Ensure cygwin references precede windows references in one's windows
>   path (Control Panel>System>Advanced>Environment Variables>System
>   Variables>Path).

This is not normally needed.  The default /etc/profile will prepend the
Cygwin binary directories to the front of the path.  Also see the note on
CYGWINROOT below.

> * Ensure customizations occur only in dotfiles in one's home
>   directory.

Again, this is sometimes unavoidable -- e.g., /etc/profile for a domain
user.

> *** Immediately before installing any new version:
>
> * Note any customizations that affect $PATH. This could be done by,
>   e.g., running
>
> find . -type f | grep -ni 'path'
>
>   from one's homedir.

FYI, some people (and scripts) set CYGWINDIR or CYGWINROOT, and use that
as the "/" mount everywhere.  This way, only CYGWINROOT needs to change.

> * Know where cygwin1.dll is installed, and ensure that 'mount' runs
>   from that directory.

cygwin1.dll is usually installed in the same directory as mount.exe,
namely /bin.

> * Record the output of "mount -m", i.e. the mount commands needed to
>   restore one's currently-working mount points.
>
> *** To rollback:
>
> 0 Change windows path to point (only) to the old version. Cygwin
>   references should precede windows references.
>
> 1 Run 'mount' using the previously recorded commands.
>
> 2 Find or recreate a shortcut to one's old bash-running batchfile.
>
> 3 Run bash, check for weirdness.
>
> 4 'cygcheck -svr', check for weirdness.
>
> Correct? Am I missing anything major? Did I get anything else wrong?

If you intend to do this sort of verification often, it probably makes
sense to set up some sort of automatic verification procedure.
"Weirdness" is too vague of a term, IMO.
	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/


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