[1.7] Editing in /etc

View: New views
8 Messages — Rating Filter:   Alert me  

[1.7] Editing in /etc

by Chris Sutcliffe-2 :: Rate this Message:

| View Threaded | Show Only this Message

I've encountered an odd issue where I can't seem to edit anything in
/etc.  I've executed 'mkpasswd -l > /etc/passwd' which worked fine.  I
then attempted 'vim /etc/passwd', and vim seems to hang with the file
name in quotes in the bottom left corner.

I can edit '/etc/passwd' using Windows native gVim just fine.

I've attached a dump of 'cygcheck -s' in case it's helpful.

Chris

--
Chris Sutcliffe
http://emergedesktop.org


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

cygcheck.out (21K) Download Attachment

Re: [1.7] Editing in /etc

by Chris Sutcliffe-2 :: Rate this Message:

| View Threaded | Show Only this Message

> I've encountered an odd issue where I can't seem to edit anything in
> /etc.  I've executed 'mkpasswd -l > /etc/passwd' which worked fine.  I
> then attempted 'vim /etc/passwd', and vim seems to hang with the file
> name in quotes in the bottom left corner.

Looks like it's related to some issue reading stdin... I executed vim
in debug mode ('vim -D passwd') and got the following:

Vim: Error reading input, exiting...
Vim: Finished.

What's really odd is that this only occurs in /etc.

Hope this helps...

Chris

--
Chris Sutcliffe
http://emergedesktop.org

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


Re: [1.7] Editing in /etc

by Chris Sutcliffe-2 :: Rate this Message:

| View Threaded | Show Only this Message

> Looks like it's related to some issue reading stdin... I executed vim
> in debug mode ('vim -D passwd') and got the following:

Fixed...  I messed up the permissions in my /dev directory.

Sorry for the noise.

Chris

--
Chris Sutcliffe
http://emergedesktop.org

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


Re: [1.7] Editing in /etc

by Marc Girod :: Rate this Message:

| View Threaded | Show Only this Message

Chris wrote:
Fixed... I messed up the permissions in my /dev directory.
There may be issues with editing some files in /etc... I think of /etc/hosts, OK... a symlink to a Windows file. Editing it, you have to be careful with preserving its ownership (including group) and permissions from the Windows point of view. I have been using the cygwin tools from a Windows Admin cmd:
c:\cygwin\bin\chown SYSTEM:SYSTEM hosts
c:\cygwin\bin\getfacl hosts.bak | c:\cygwin\bin\setfacl -f - hosts
Marc

Re: [1.7] Editing in /etc

by Chris Sutcliffe-2 :: Rate this Message:

| View Threaded | Show Only this Message

>> Looks like it's related to some issue reading stdin... I executed vim
>> in debug mode ('vim -D passwd') and got the following:
>
> Fixed...  I messed up the permissions in my /dev directory.

Perhaps I spoke to soon...  I'm still having the issue, this time with
a domain based user.

I executed 'mkpasswd -l -c > /etc/passwd' which again acted as
expected, and the /etc/passwd file was created.  I went to edit the
file with 'vim -D /etc/passwd' to change the users' default group and
vim again displayed the message about an error opening input.

Looking in /dev I have:

drwxrwxrwt+ 1 ironhead Users  0 Dec  5 08:22 shm/
drwxrwxrwt+ 1 ironhead Users  0 Dec  5 08:22 mqueue/
lrwxrwxrwx  1 ironhead Users 15 Dec  5 08:22 stdin -> /proc/self/fd/0
lrwxrwxrwx  1 ironhead Users 15 Dec  5 08:22 stdout -> /proc/self/fd/1
lrwxrwxrwx  1 ironhead Users 15 Dec  5 08:22 stderr -> /proc/self/fd/2
lrwxrwxrwx  1 ironhead Users 13 Dec  5 08:22 fd -> /proc/self/fd/

(note that the domain user ID is 'csutclif' and 'ironhead' is the
local user ID that was giving me problems before).

Further checking on stdin reveals:

$ ls -ltr /proc/self/fd/0
lrwxrwxrwx 1 csutclif Users 0 Nov 30  2006 /proc/self/fd/0 -> /dev/tty0

however, there is no /dev/tty0.  Should there be?  If so, how do I create it?

I'm at a loss here, could anybody hazard an idea as to what could be
happening, or how I could further debug the issue?

Thanx!

Chris

--
Chris Sutcliffe
http://emergedesktop.org

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


Re: [1.7] Editing in /etc

by Corinna Vinschen-2 :: Rate this Message:

| View Threaded | Show Only this Message

On Mar  2 08:36, Chris Sutcliffe wrote:
> >> Looks like it's related to some issue reading stdin... I executed vim
> >> in debug mode ('vim -D passwd') and got the following:
> >
> > Fixed...  I messed up the permissions in my /dev directory.
>
> Perhaps I spoke to soon...  I'm still having the issue, this time with
> a domain based user.

I can't reproduce that, neither from a console window, nor from a mintty
window.

> I executed 'mkpasswd -l -c > /etc/passwd' which again acted as
> expected, and the /etc/passwd file was created.  I went to edit the
> file with 'vim -D /etc/passwd' to change the users' default group and
> vim again displayed the message about an error opening input.

So this does not only occur in /etc?  What happens if you start vim
without the -D flag?
>
> Looking in /dev I have:

The content of /dev shouldn't matter, in theory.

> $ ls -ltr /proc/self/fd/0
> lrwxrwxrwx 1 csutclif Users 0 Nov 30  2006 /proc/self/fd/0 -> /dev/tty0
>
> however, there is no /dev/tty0.  Should there be?  If so, how do I create it?

http://cygwin.com/1.7/cygwin-ug-net/using-specialnames.html#pathnames-posixdevices

> I'm at a loss here, could anybody hazard an idea as to what could be
> happening, or how I could further debug the issue?

Maybe something in /etc is making problems but I can't imagine what that
is.  This is a typical case where you just have to debug this.  Strace
might reveal a problem here.  Or maybe it's a BLODA problem.


Corinna

--
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

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


Re: [1.7] Editing in /etc

by Chris Sutcliffe-2 :: Rate this Message:

| View Threaded | Show Only this Message

>> Perhaps I spoke to soon...  I'm still having the issue, this time with
>> a domain based user.
>
> I can't reproduce that, neither from a console window, nor from a mintty
> window.

I've tried from both a console window and mintty and experience the
same behaviour.

>> I executed 'mkpasswd -l -c > /etc/passwd' which again acted as
>> expected, and the /etc/passwd file was created.  I went to edit the
>> file with 'vim -D /etc/passwd' to change the users' default group and
>> vim again displayed the message about an error opening input.
>
> So this does not only occur in /etc?  What happens if you start vim
> without the -D flag?

This only occurs for any file in /etc.  For simplicity, I tried:

$ cd /etc
$ echo "Some text" > test.txt
$ cat test.txt
Some text
$ vim text.txt

and all I get is a screen with nothing but "test.txt" in the lower
left hand corner.

>> Looking in /dev I have:
>
> The content of /dev shouldn't matter, in theory.
>
>> $ ls -ltr /proc/self/fd/0
>> lrwxrwxrwx 1 csutclif Users 0 Nov 30  2006 /proc/self/fd/0 -> /dev/tty0
>>
>> however, there is no /dev/tty0.  Should there be?  If so, how do I create it?
>
> http://cygwin.com/1.7/cygwin-ug-net/using-specialnames.html#pathnames-posixdevices

Ah, so the permissions on tty0 look correct:

$ ls -l /dev/tty0
crw-rw-rw- 1 csutclif Users 136, 0 Nov 30  2006 /dev/tty0

>> I'm at a loss here, could anybody hazard an idea as to what could be
>> happening, or how I could further debug the issue?
>
> Maybe something in /etc is making problems but I can't imagine what that
> is.  This is a typical case where you just have to debug this.  Strace
> might reveal a problem here.  Or maybe it's a BLODA problem.

How do I capture the strace output to a file?  I tried 'strace vim
/etc/passwd > strace.out' but vim complained about stdout being
redirected.

Thanx!

Chris

--
Chris Sutcliffe
http://emergedesktop.org

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


Re: [1.7] Editing in /etc

by Larry Hall (Cygwin) :: Rate this Message:

| View Threaded | Show Only this Message

Chris Sutcliffe wrote:

>>> Perhaps I spoke to soon...  I'm still having the issue, this time with
>>> a domain based user.
>> I can't reproduce that, neither from a console window, nor from a mintty
>> window.
>
> I've tried from both a console window and mintty and experience the
> same behaviour.
>
>>> I executed 'mkpasswd -l -c > /etc/passwd' which again acted as
>>> expected, and the /etc/passwd file was created.  I went to edit the
>>> file with 'vim -D /etc/passwd' to change the users' default group and
>>> vim again displayed the message about an error opening input.
>> So this does not only occur in /etc?  What happens if you start vim
>> without the -D flag?
>
> This only occurs for any file in /etc.  For simplicity, I tried:
>
> $ cd /etc
> $ echo "Some text" > test.txt
> $ cat test.txt
> Some text
> $ vim text.txt
>
> and all I get is a screen with nothing but "test.txt" in the lower
> left hand corner.
>
>>> Looking in /dev I have:
>> The content of /dev shouldn't matter, in theory.
>>
>>> $ ls -ltr /proc/self/fd/0
>>> lrwxrwxrwx 1 csutclif Users 0 Nov 30  2006 /proc/self/fd/0 -> /dev/tty0
>>>
>>> however, there is no /dev/tty0.  Should there be?  If so, how do I create it?
>> http://cygwin.com/1.7/cygwin-ug-net/using-specialnames.html#pathnames-posixdevices
>
> Ah, so the permissions on tty0 look correct:
>
> $ ls -l /dev/tty0
> crw-rw-rw- 1 csutclif Users 136, 0 Nov 30  2006 /dev/tty0
>
>>> I'm at a loss here, could anybody hazard an idea as to what could be
>>> happening, or how I could further debug the issue?
>> Maybe something in /etc is making problems but I can't imagine what that
>> is.  This is a typical case where you just have to debug this.  Strace
>> might reveal a problem here.  Or maybe it's a BLODA problem.
>
> How do I capture the strace output to a file?  I tried 'strace vim
> /etc/passwd > strace.out' but vim complained about stdout being
> redirected.

strace -o strace.out vim /etc/passwd


--
Larry Hall                              http://www.rfk.com
RFK Partners, Inc.                      (508) 893-9779 - RFK Office
216 Dalton Rd.                          (508) 893-9889 - FAX
Holliston, MA 01746

_____________________________________________________________________

A: Yes.
 > Q: Are you sure?
 >> A: Because it reverses the logical flow of conversation.
 >>> Q: Why is top posting annoying in email?

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