[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Problem solved, sort of (was: Re: 2.1.7 ok except gpm not ok)



I put a Cc: to gpm@packages.debian.org since a forward of my 
previous report was sent there. I guess this is not gpm's fault 
after all.

Adam Di Carlo wrote:
> On Sat, 13 Feb 1999 16:46:08 +0300, Heikki Vatiainen <hessu@cs.tut.fi> said:
> > As you can see, gpm dies when it tries to freopen(). I tried to
> > strace it, but it was impossible to do, since it fork()s a child and
> > the failure happens after that. There is no command line option to
> > prevent it from backgrounding itself.
> 
> Just use 'strace -f ...'

Ugh. I was so sure strace could not handle forks I did not even 
check the manual page. Thanks for reminding me, I found the 
solution with your advise.

I tried strace -f against working gpm on my other box which runs 
potato. There I noticed open("/dev/console"...) does not fail 
as it does with my slink boot disk test machine. Also, on my
potato box /dev/console is a symlink to /dev/tty0. With these
hints I did the following (see the typescript file below) which
solves the gpm problem.

In short, the solution is to
    (cd /dev; mv console console.old; ln -s tty0 console)
After that gpm backgrounds itself nicely and things work.

The real question remains: Should console be a symlink to 
tty0? At least 2.0.35 linux/Documentation/devices.txt says:
[cut]
  4 char        TTY devices
                  0 = /dev/console      Console device

                  1 = /dev/tty1         First virtual console
                      ...
[cut]

Script started on Mon Feb 15 17:17:10 1999
jopus:~# cd /dev

jopus:/dev# strace -f /usr/sbin/gpm -m /dev/psaux -t ps2 2>&1 |tail -15
brk(0x8054a28)                          = 0x8054a28
brk(0x8055000)                          = 0x8055000
open("/dev/psaux", O_RDWR|O_NONBLOCK)   = 4
fcntl(4, F_GETFL)                       = 0x802 (flags O_RDWR|O_NONBLOCK)
fcntl(4, F_SETFL, O_RDWR)               = 0
fork()                                  = 474
[pid   473] _exit(0)                    = ?
[pid   474] close(2)                    = 0
open("/dev/console", O_WRONLY|O_CREAT|O_TRUNC, 0666) = -1 ENODEV (Operation not supported by device)
fstat(1, {st_mode=S_IFIFO|0600, st_size=0, ...}) = 0
mmap(0, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x4000c000
write(1, "gpm: freopen(stderr) failed\n", 28gpm: freopen(stderr) failed
) = 28
munmap(0x4000c000, 4096)                = 0
_exit(1)                                = ?

jopus:/dev# ls -l console
crw--w--w-   1 root     tty        5,   1 Feb 11 01:03 console

jopus:/dev# ls -l tty0
crw--w--w-   1 root     tty        4,   0 Feb 15 16:31 tty0

jopus:/dev# mv console console.hessu
jopus:/dev# ln -s tty0 console
jopus:/dev# /usr/sbin/gpm -m /dev/psaux -t ps2

jopus:/dev# cat /proc/interrupts 
 0:     283545   timer
 1:       5083   keyboard
 2:          0   cascade
 5:       1006   eth0
 8:          2 + rtc
12:       5021   PS/2 Mouse
13:          1   math error
14:       4954 + ide0
15:          0 + ide1
jopus:/dev# exit

Script done on Mon Feb 15 17:19:04 1999


// Heikki
-- 
Heikki Vatiainen                  * hessu@cs.tut.fi
Tampere University of Technology  * Tampere, Finland



--  
To UNSUBSCRIBE, email to debian-testing-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org


Reply to: