Re: System freeze with multiple ttys in Debian Jessie

2015-08-22 Thread Jonathan de Boyne Pollard

Brian:
> Systemd handles the terminals [...]

... and all of the mucking around that you two and participants in some 
other Debian bugs are doing, laudable as it is, is to tweak something 
that is in fact already superseded by TTYVTDisallocate=yes in 
autovt@.service .  (-:


August Karlstrom:
> According to the man page, clear_console "changes the foreground 
virtual terminal to another terminal and then back to the original 
terminal."


... and it picks VT#2 as that other if you are on VT#1, and VT#1 otherwise.

Ironically, this way of doing this has been unnecessary since a change 
to the kernel that happened in 2011.  There's a non-standard control 
sequence, but common to xterm, PuTTY, the Linux kernel terminal 
emulator, and my console-terminal-emulator, that just erases the 
scrollback buffer.  No ioctl()s required at all; terminal switching, 
disallocating, or otherwise.  I added console-clear (a.k.a. 
clear_console) to nosh version 1.19, just announced.  But note, on the 
gripping hand, that one doesn't really need *either* version if (a) one 
is using autovt@ systemd services with TTYVTDisallocate=yes or (b) if 
one is using console-terminal-emulator on Linux or PC-BSD/FreeBSD.  In 
(a) process #1 clears the scrollback buffers; and in (b) the terminal 
emulator clears its display buffer at terminal hangup as standard.


So the first thing for you, as systemd Linux users, to try is just 
excising the use of "clear_console" from your .bash_logout (and 
skeleton, and equivalents for your other login shells) entirely.


||



Re: System freeze with multiple ttys in Debian Jessie

2015-07-03 Thread Brian
On Fri 03 Jul 2015 at 12:13:22 +0200, August Karlstrom wrote:

> On 2015-07-03 01:00, Brian wrote:
> >On Thu 02 Jul 2015 at 23:35:56 +0100, Brian wrote:
> >
> >>The colour has changed to "That looks like light at the end of the
> >>tunnel". :)
> >
> >The light is getting brighter.
> >
> >$SHLVL appears to be one of the players. Change
> >
> >   if [ "$SHLVL" = 1 ]; then
> >
> >in ~/.bash_logout to
> >
> >   if [ "$SHLVL" = 2 ]; then
> >
> >and see how you go on.
> 
> Makes sense. When the shell level is one I can't see what
> clear_console achieves - even without the command the console is
> cleared before showing the login prompt for the current tty.
> 
> Thanks Brian for digging into this.

I'm still very unsure what responsibilty xinit has for the behaviour we
both observe, But I tossed a coin and

  https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=791342

is the result.


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: 
https://lists.debian.org/03072015161020.75d36600d...@desktop.copernicus.demon.co.uk



Re: System freeze with multiple ttys in Debian Jessie

2015-07-03 Thread August Karlstrom

On 2015-07-03 00:40, Brian wrote:

I do not know what the explanation is in any detail but here is
something to do which is constructive and instructive:

mv ~/.bash_logout ~/.bash_logout-orig

and exit. Where are you now? X or a terminal?


Yes, without the logout script it works as expected; no tty switching
upon logout.


The ~/.bash_logout files on this machine and my working unstable
machine are identical. clear_console(1) on both tells me the same
thing.

clear_console -q

on the unstable machine always leaves me at a terminal; on this
machine the command almost always puts me into X.


According to the man page, clear_console "changes the foreground virtual
terminal to another  terminal  and  then back to the original terminal."
Apparently it's the switching back that  sometimes fails.


-- August


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Archive: https://lists.debian.org/mn5n60$vpu$1...@speranza.aioe.org



Re: System freeze with multiple ttys in Debian Jessie

2015-07-03 Thread August Karlstrom

On 2015-07-03 01:00, Brian wrote:

On Thu 02 Jul 2015 at 23:35:56 +0100, Brian wrote:


The colour has changed to "That looks like light at the end of the
tunnel". :)


The light is getting brighter.

$SHLVL appears to be one of the players. Change

   if [ "$SHLVL" = 1 ]; then

in ~/.bash_logout to

   if [ "$SHLVL" = 2 ]; then

and see how you go on.


Makes sense. When the shell level is one I can't see what clear_console 
achieves - even without the command the console is cleared before 
showing the login prompt for the current tty.


Thanks Brian for digging into this.


-- August


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Archive: https://lists.debian.org/mn5n81$vpu$2...@speranza.aioe.org



Re: System freeze with multiple ttys in Debian Jessie

2015-07-02 Thread Brian
On Thu 02 Jul 2015 at 23:35:56 +0100, Brian wrote:

> The colour has changed to "That looks like light at the end of the
> tunnel". :)

The light is getting brighter.

$SHLVL appears to be one of the players. Change

  if [ "$SHLVL" = 1 ]; then

in ~/.bash_logout to

  if [ "$SHLVL" = 2 ]; then

and see how you go on.


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: 
https://lists.debian.org/02072015235332.ed4b85dee...@desktop.copernicus.demon.co.uk



Re: System freeze with multiple ttys in Debian Jessie

2015-07-02 Thread Brian
On Thu 02 Jul 2015 at 18:45:24 +0100, Brian wrote:

> On Thu 02 Jul 2015 at 17:58:35 +0200, August Karlstrom wrote:
> 
> > Could it be related to the graphics driver? What card/driver do you
> > use? I remember having issues with switching between ttys when using
> > the NVIDIA driver in Debian Wheezy:
> 
> I don't know. The machine uses nouveau and my graphics expertise is very
> low. Sorted the apparent randomness: use CTRL+ALT+F1 and go to a terminal
> in the usual way works for me.
> 
> > http://forums.linuxmint.com/viewtopic.php?f=42&t=168108
> > 
> > However, in Wheezy I never had any such problems with the (free
> > default) Nouveau driver.
> 
> I have another machine which has never run anything but unstable with
> sysvinit for many years. It also uses nouveau. There is no sign of this
> behaviour on it. Colour me stumped.

The colour has changed to "That looks like light at the end of the
tunnel". :)

The "exit" command is a bash builtin command. It causes bash to exit, as
does CTRL-D. When bash exits a getty is respawned with a new login
prompt on the terminal. You do not see this new login prompt because you
have been switched to X - but it is there; have a look at 'ps ax'. On my
machine I can get to it (X is on tty1) by pressing CTRL+ALT+F1 (I stay
in X at this point) and then CTRL+ALT+Fn (I am now on ttyn).

The graphics driver route doesn't feel right as an explanation. I do not
know what the explanation is in any detail but here is something to do
which is constructive and instructive:

  mv ~/.bash_logout ~/.bash_logout-orig

and exit. Where are you now? X or a terminal?

The ~/.bash_logout files on this machine and my working unstable machine
are identical. clear_console(1) on both tells me the same thing.

  clear_console -q

on the unstable machine always leaves me at a terminal; on this machine
the command almost always puts me into X.



-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: https://lists.debian.org/20150702223556.gd20...@copernicus.demon.co.uk



Re: System freeze with multiple ttys in Debian Jessie

2015-07-02 Thread Brian
On Thu 02 Jul 2015 at 17:58:35 +0200, August Karlstrom wrote:

> On 2015-07-02 13:50, Brian wrote:
> 
> >There is no hanging this time but returning to a tty after logging
> >out of one doesn't occur most of the time. When it does happen it is
> >almost as though pressing keys at random is the trigger. A bug in
> >xinit?
> >
> >My ~/.xsession:
> >
> >xterm & exec fvwm
> 
> Could it be related to the graphics driver? What card/driver do you
> use? I remember having issues with switching between ttys when using
> the NVIDIA driver in Debian Wheezy:

I don't know. The machine uses nouveau and my graphics expertise is very
low. Sorted the apparent randomness: use CTRL+ALT+F1 and go to a terminal
in the usual way works for me.

> http://forums.linuxmint.com/viewtopic.php?f=42&t=168108
> 
> However, in Wheezy I never had any such problems with the (free
> default) Nouveau driver.

I have another machine which has never run anything but unstable with
sysvinit for many years. It also uses nouveau. There is no sign of this
behaviour on it. Colour me stumped.


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: 
https://lists.debian.org/02072015183657.34634657c...@desktop.copernicus.demon.co.uk



Re: System freeze with multiple ttys in Debian Jessie

2015-07-02 Thread August Karlstrom

On 2015-07-02 13:50, Brian wrote:

On Thu 02 Jul 2015 at 10:50:07 +0100, Brian wrote:


Systemd handles the terminals so this very much looks like a bug
in that package. Do you intend to report it? I don't see what is
special about tty1.


I'm having doubts that systemd is involved in this issue. Installing
sysvinit-core and purging systemd results in similar behaviour when X
is started on tty1.


I get similar results if I instead run X in in tty2 and log in and out 
on tty1 - the X session flashes by or I end up in X and sometimes the 
computer hangs.



There is no hanging this time but returning to a tty after logging
out of one doesn't occur most of the time. When it does happen it is
almost as though pressing keys at random is the trigger. A bug in
xinit?

My ~/.xsession:

xterm & exec fvwm


Could it be related to the graphics driver? What card/driver do you use? 
I remember having issues with switching between ttys when using the 
NVIDIA driver in Debian Wheezy:


http://forums.linuxmint.com/viewtopic.php?f=42&t=168108

However, in Wheezy I never had any such problems with the (free default) 
Nouveau driver.



-- August


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Archive: https://lists.debian.org/mn3n39$qns$1...@speranza.aioe.org



Re: System freeze with multiple ttys in Debian Jessie

2015-07-02 Thread Brian
On Thu 02 Jul 2015 at 10:50:07 +0100, Brian wrote:

> Systemd handles the terminals so this very much looks like a bug in
> that package. Do you intend to report it? I don't see what is special
> about tty1.

I'm having doubts that systemd is involved in this issue. Installing
sysvinit-core and purging systemd results in similar behaviour when
X is started on tty1. There is no hanging this time but returning to
a tty after logging out of one doesn't occur most of the time. When
it does happen it is almost as though pressing keys at random is the
trigger. A bug in xinit?

My ~/.xsession:

  xterm &
  exec fvwm


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: 
https://lists.debian.org/02072015124045.56b2b67f6...@desktop.copernicus.demon.co.uk



Re: System freeze with multiple ttys in Debian Jessie

2015-07-02 Thread Brian
On Thu 02 Jul 2015 at 07:07:58 +0200, August Karlstrom wrote:

> On 2015-07-02 00:20, Brian wrote:
> >Suppose you reboot. You will be on tty1 afterwards. Change to tty2, log
> >in and then log out with the exit command. Are you still on tty2?
> 
> Yes, this works as expected. I then logged in on tty1 and started X.
> Then I logged in and out of tty2 four times and the computer behaved
> differently each time. On the first logout from tty2 I saw X on tty1
> flashing by before ending up on the tty2 login prompt. On the second
> logout from tty2 I ended up in X on tty1 (but with no freeze). The
> third logout was like the first with X flashing by. On the fourth
> logout I ended up in X on tty1 again but now the computer hanged
> completely.

Well, well, so it does. Not quite with the same sequence but logging
out from any terminal puts you back to X on tty1 and I can get a freeze
by trying to switch back to a terminal. None of this happens for me if
X is started on any terminal other than tty1.

Systemd handles the terminals so this very much looks like a bug in
that package. Do you intend to report it? I don't see what is special
about tty1.


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: 
https://lists.debian.org/02072015103950.9b75d2691...@desktop.copernicus.demon.co.uk



Re: System freeze with multiple ttys in Debian Jessie

2015-07-01 Thread August Karlstrom

On 2015-07-01 20:50, Elimar Riesebieter wrote:

* August Karlstrom  [2015-07-01 08:30 +0200]:


I run Debian 8.1. With X-Windows running in tty1, if I login on tty2
(without X) and then logout, instead of seeing the tty2 login prompt the
system switches to tty1 and X freezes; I cannot move the mouse, not even
switch to a different tty. The only keyboard command that seems to work is
Ctrl-Alt-Delete. Has anyone experienced this?


How did you managed to run X from tty1?


With the startx command. As far as I understand, systemd uses the same 
tty for X.



-- August


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Archive: https://lists.debian.org/mn2h7b$t7c$1...@speranza.aioe.org



Re: System freeze with multiple ttys in Debian Jessie

2015-07-01 Thread August Karlstrom

On 2015-07-02 00:20, Brian wrote:

Suppose you reboot. You will be on tty1 afterwards. Change to tty2, log
in and then log out with the exit command. Are you still on tty2?


Yes, this works as expected. I then logged in on tty1 and started X. 
Then I logged in and out of tty2 four times and the computer behaved 
differently each time. On the first logout from tty2 I saw X on tty1 
flashing by before ending up on the tty2 login prompt. On the second 
logout from tty2 I ended up in X on tty1 (but with no freeze). The third 
logout was like the first with X flashing by. On the fourth logout I 
ended up in X on tty1 again but now the computer hanged completely.


My ~/.xinitrc looks like this:

#!/bin/sh

#use settings in .Xresources
if [ -f ~/.Xresources ]; then
xrdb -merge ~/.Xresources
fi

#disable system beep
xset -b

#reassign right Command key to right Alt key
setxkbmap -option lv3:rwin_switch

bbkeys &
xscreensaver -no-splash &
exec dbus-launch --exit-with-session blackbox

My computer is a MacMini from 2009 with an NVIDIA GeForce 9400 and I use 
the default Nouveau graphics driver. I had no issues with virtual 
consoles when I ran Debian Wheezy on the same computer.



-- August


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Archive: https://lists.debian.org/mn2gvd$sih$1...@speranza.aioe.org



Re: System freeze with multiple ttys in Debian Jessie

2015-07-01 Thread Brian
On Wed 01 Jul 2015 at 21:54:40 +0200, August Karlstrom wrote:

> On 2015-07-01 20:50, Brian wrote:
> >On Wed 01 Jul 2015 at 08:30:52 +0200, August Karlstrom wrote:
> >
> >>I run Debian 8.1. With X-Windows running in tty1, if I login on tty2
> >>(without X) and then logout, instead of seeing the tty2 login prompt
> >>the system switches to tty1 and X freezes; I cannot move the mouse,
> >>not even switch to a different tty. The only keyboard command that
> >>seems to work is Ctrl-Alt-Delete. Has anyone experienced this?
> >
> >You appear to have two things you regard as issues:
> >
> >1. Logging out of tty2 in some way you do not specify puts you back on
> >tty1 with X. How do you leave tty2?
> 
> With the exit command.
> 
> >2. X is misbehaving.
> >
> >The only way I can think of that you can have X on tty1 is by using
> >startx. Is startx the way you start X?
> 
> Yes, that's correct. I don't use a display manager.
> 
> >The second thing is whether this 8.1 Debian is an upgrade or a new
> >install. Which is it?
> 
> I have freshly installed Debian 8.0 which has then been upgraded to 8.1.

Suppose you reboot. You will be on tty1 afterwards. Change to tty2, log
in and then log out with the exit command. Are you still on tty2?


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: 
https://lists.debian.org/01072015230858.0d55ead1b...@desktop.copernicus.demon.co.uk



Re: System freeze with multiple ttys in Debian Jessie

2015-07-01 Thread August Karlstrom

On 2015-07-01 20:50, Brian wrote:

On Wed 01 Jul 2015 at 08:30:52 +0200, August Karlstrom wrote:


I run Debian 8.1. With X-Windows running in tty1, if I login on tty2
(without X) and then logout, instead of seeing the tty2 login prompt
the system switches to tty1 and X freezes; I cannot move the mouse,
not even switch to a different tty. The only keyboard command that
seems to work is Ctrl-Alt-Delete. Has anyone experienced this?


You appear to have two things you regard as issues:

1. Logging out of tty2 in some way you do not specify puts you back on
tty1 with X. How do you leave tty2?


With the exit command.


2. X is misbehaving.

The only way I can think of that you can have X on tty1 is by using
startx. Is startx the way you start X?


Yes, that's correct. I don't use a display manager.


The second thing is whether this 8.1 Debian is an upgrade or a new
install. Which is it?


I have freshly installed Debian 8.0 which has then been upgraded to 8.1.


-- August


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Archive: https://lists.debian.org/mn1ghv$ru6$1...@speranza.aioe.org



Re: System freeze with multiple ttys in Debian Jessie

2015-07-01 Thread Brian
On Wed 01 Jul 2015 at 08:30:52 +0200, August Karlstrom wrote:

> I run Debian 8.1. With X-Windows running in tty1, if I login on tty2
> (without X) and then logout, instead of seeing the tty2 login prompt
> the system switches to tty1 and X freezes; I cannot move the mouse,
> not even switch to a different tty. The only keyboard command that
> seems to work is Ctrl-Alt-Delete. Has anyone experienced this?

You appear to have two things you regard as issues:

1. Logging out of tty2 in some way you do not specify puts you back on
   tty1 with X. How do you leave tty2?

2. X is misbehaving.

The only way I can think of that you can have X on tty1 is by using
startx. Is startx the way you start X?

The second thing is whether this 8.1 Debian is an upgrade or a new
install. Which is it?


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: 
https://lists.debian.org/01072015193301.390ed05ac...@desktop.copernicus.demon.co.uk



Re: System freeze with multiple ttys in Debian Jessie

2015-07-01 Thread Elimar Riesebieter
* August Karlstrom  [2015-07-01 08:30 +0200]:

> I run Debian 8.1. With X-Windows running in tty1, if I login on tty2
> (without X) and then logout, instead of seeing the tty2 login prompt the
> system switches to tty1 and X freezes; I cannot move the mouse, not even
> switch to a different tty. The only keyboard command that seems to work is
> Ctrl-Alt-Delete. Has anyone experienced this?

How did you managed to run X from tty1?

Elimar
-- 
 Experience is something you don't get until
  just after you need it!


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: https://lists.debian.org/20150701183401.ga2...@galadriel.home.lxtec.de