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: passwd & group file problems ?


Ugh, top-posting.  Reformatted.

On Thu, 9 Jun 2005, Roy Wiseman wrote:

> --- Igor Pechtchanski <pechtcha@XX.XXX.XXX> wrote:

<http://cygwin.com/acronyms/#PCYMTNQREAIYR>.  Thanks.

> > On Thu, 9 Jun 2005, Roy Wiseman wrote:
> >
> > > Hello,
> > >
> > > I work in a corporate environment, with very limited
> > > internet access, and I want to distribute cygwin to
> > > some sysadmins who can make good use of these tools. I
> > > cannot run the cygwin setup across the internet, and I
> > > do not want to download all the binaries to put on the
> > > server. We want to package a specific subset of cygwin
> > > that we require into a package that we can distribute
> > > to sysadmins. I've done this and it works very well,
> >
> > I would be a bit cautious in this situation.  It's true that most
> > Cygwin programs will work just fine when copied from machine to
> > machine. However, some other things, specifically hard and symbolic
> > links, are created during the postinstall phase, and may be specific
> > to the installation machine.  Unless the other machines have exactly
> > the same configuration, there may be inconsistencies in the copied
> > installation.
> >
> > You'll also need to replicate the mounts, which I suspect is your
> > current problem anyway.  Run 'mount -m > /mounts.bat' on the machine
> > you use as the template installation, and run /mounts.bat after
> > copying.  And you will need to regenerate /etc/passwd and /etc/group
> > (since that information is also machine-specific).  You can add the
> > two commands reported (mkpasswd and mkgroup) to the end of
> > /mounts.bat.
> >
> > > except for the passwd and group security information
> > > generation which is tied to the machine the install
> > > was done on, and I have no idea how to change this.
> > >
> > > The message I get on running cygwin.bat on any other
> > > system but the one where it is installed is :
> > >
> > > C:\cygwin>cygwin
> > > Your group is currently "mkpasswd".  This indicates that
> > > the /etc/passwd (and possibly /etc/group) files should
> > > be rebuilt.
> > > See the man pages for mkpasswd and mkgroup then, for
> > > example, run
> > > mkpasswd -l [-d] > /etc/passwd
> > > mkgroup  -l [-d] > /etc/group
> > > Note that the -d switch is necessary for domain users.
> > >
> > > I expect this is to do with the passwd and group files
> > > from what I know of unix, and these instructions have
> > > something to do with the solution, but I have tried
> > > these commands in every possible way that I can think
> > > of, but cannot get this error to disappear and
> > > properly register cygwin for the user. I've tried
> > > googling and all the commands I can think of, but I'm
> > > stumped.
> > >
> > > Please, can someone tell me how to correct this in the
> > > cygwin system so that I can distribute it to the
> > > sysadmins that would like to use these excellent tools?
> >
> > It would have been better had you followed the instructions in the
> > Cygwin problem reporting guidelines at
> > <http://cygwin.com/problems.html> and attached the output of "cygcheck
> > -svr" on the failing system.  Without that information, the above
> > guess (missing mounts) is all I can offer.
>
> Hi Igor,
>
> those mount commands don't seem to do much for this
> situation. same problems.

Have you *run* /mounts.bat on the target machine?  It's unclear whether
your cygcheck output is from the original installation machine or the new
machine.

Regardless, it shows a few unrelated problems with the machine.  First
off, you *do* have multiple Cygwin1.dll's in your path -- very nasty, and
likely to bite you at some point soon.  Secondly, some application
(presumably Norton Ghost) has inserted a quoted string into your PATH,
which confuses Cygwin.  Remove the quotes from the PATH.

Also, as your cygcheck output shows, you are in a domain.  It's quite
possible that the domain controller really is taking more than 30 minutes
to return the set of users and groups (for large domains).  The "-u"/"-g"
options of mkpasswd/mkgroup respectively may be helpful.

> you mention the hard and symbolic links, are created
> during the postinstall phase. this is very
> interesting, are there no commands to make that
> process rerun outside of the postinstall phase ?

Sure, they're just scripts.  One potential problem is that some
postinstall scripts create files, and don't modify them once those files
are created.  They rely on a pristine installation to get the files right.
So, if you have such files on the source machine, they may not be correct
on the target machine...

> I've attached my cygcheck.out file here.
>
> my current situation is :
> - mkpasswd (with -l and/or -d) does nothing, this
> command hangs for over 30 minutes, and does nothing

I'm a bit skeptical about "mkpasswd -l" alone taking 30 minutes.  Does
"net user" hang also?  If mkpasswd hangs only with -d, try "(mkpasswd -l
-c; mkpasswd -d -u nlwiso) > /etc/passwd".

> - mkgroup (with -l and/or -d) does nothing, this
> command hangs for over 30 minutes, and does nothing

This one's harder, as you'll need to know which groups you're a member of.
You could try running "net user nlwiso" to find out the group membership
(though I'm not certain how to ensure that the user being queried is
EMEA\nlwiso); run "mkgroup -l -c > /etc/group" and then run "mkgroup -d
-g GROUPNAME >> /etc/group" for every group printed by "net user"...

> - mount -m > /mounts.bat is no help, same errors apply.

As I mentioned above, you also need to *run* /mounts.bat on the target
machine.

> - is there some way to make the postinstall process
> kick off again, outside of the setup process ?

Well, you could find out exactly what setup.exe does on a new machine,
then split the installation into two parts (before and after the
postinstall scripts), then copy the image created by the "before" part on
the source machine to the target machine, and then perform the "after"
part on the target machine.  But that would probably involve lots of
effort which would be better spent contributing to the setup codebase
anyway (as the current effort of decoupling installation from package
selection is very similar).

See <http://sources.redhat.com/cygwin-apps/setup.html> for how you can
contribute.
HTH,
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha@cs.nyu.edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor@watson.ibm.com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski, Ph.D.
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"The Sun will pass between the Earth and the Moon tonight for a total
Lunar eclipse..." -- WCBS Radio Newsbrief, Oct 27 2004, 12:01 pm EDT

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