Trapped Followup

George (greerga@nidhogg.ham.muohio.edu)
Wed, 25 Mar 1998 23:15:41 -0500 (EST)


While perusing the virtual terminal code, I noticed that if the controlling
terminal dies, the terminal is set back to text screen and control
relinquished. Well, I sent X a SIGTERM a long time ago and I still cannot
switch out of tty24...(Right ALT+F12)

I wrote a quick program to take care of the 'vt_dont_switch' variable:

moving:~# cat unlock.c
#include <linux/vt.h>
#include <fcntl.h>

int main()
{
int fd = open("/dev/console", O_WRONLY);
ioctl(fd, VT_UNLOCKSWITCH, 0);
ioctl(fd, VT_RELDISP, 2);
}

First ioctl() to unlock my switching, second to relinquish the display
control in case it was left in the process controlled state:

open("/dev/console", O_WRONLY) = 3
ioctl(3, VT_UNLOCKSWITCH, 0) = 0
ioctl(3, VT_RELDISP, 0x2) = -1 EINVAL (Invalid argument)
_exit(-1) = ?

So I gather the unlock worked (I'm root), and the console is not X
controlled....but I still cannot switch VT's.

Alt+SysRq+K didn't work (although it did kill my PPP session since it was
that console), nor did Alt+SysRq+R.

I'm out of ideas looking at vt.c. Any other ideas as to what could be
keeping my console stuck on tty24? (or should I just reboot and forget it?)

-- 
George Greer	greerga@muohio.edu | Genius may have its limitations, but
http://www.ham.muohio.edu/~greerga | stupidity is not thus handicapped.
                                   |                    -- Elbert Hubbard

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu