Re: rc.d/xdm, check for broken xkb

2011-11-02 Thread Kenneth R Westerback
On Tue, Nov 01, 2011 at 04:39:29PM +, Stuart Henderson wrote:
 If you hit the xkb file/directory problem (for example, if you follow
 the upgrading without install kernel instructions), you can't type at
 the keyboard, even to switch to a text console. 
 
 What does anyone think about disabling xdm if this brokenness is found?
 
 Index: xdm
 ===
 RCS file: /cvs/src/etc/rc.d/xdm,v
 retrieving revision 1.1
 diff -u -p -r1.1 xdm
 --- xdm   7 Jul 2011 18:42:17 -   1.1
 +++ xdm   1 Nov 2011 16:35:39 -
 @@ -6,4 +6,10 @@ daemon=/usr/X11R6/bin/xdm
  
  . /etc/rc.d/rc.subr
  
 +rc_pre() {
 + # XXX Mitigate xkb mistake in 5.0, better not to run xdm than
 + # leave a broken keyboard
 + [ -d /usr/X11R6/share/X11/xkb/symbols/srvr_ctrl ]  return 1
 +}
 +
  rc_cmd $1
 

I haven't encountered the problem, but if xdm just failed I would be
somewhat surprised. Is there a useful message logged somewhere that would
indicate why xdm isn't starting? If there were such a message I think
this is a good idea.

 Ken



Re: rc.d/xdm, check for broken xkb

2011-11-02 Thread Brad

On 02/11/11 8:31 AM, Kenneth R Westerback wrote:

On Tue, Nov 01, 2011 at 04:39:29PM +, Stuart Henderson wrote:

If you hit the xkb file/directory problem (for example, if you follow
the upgrading without install kernel instructions), you can't type at
the keyboard, even to switch to a text console.

What does anyone think about disabling xdm if this brokenness is found?

Index: xdm
===
RCS file: /cvs/src/etc/rc.d/xdm,v
retrieving revision 1.1
diff -u -p -r1.1 xdm
--- xdm 7 Jul 2011 18:42:17 -   1.1
+++ xdm 1 Nov 2011 16:35:39 -
@@ -6,4 +6,10 @@ daemon=/usr/X11R6/bin/xdm

  . /etc/rc.d/rc.subr

+rc_pre() {
+   # XXX Mitigate xkb mistake in 5.0, better not to run xdm than
+   # leave a broken keyboard
+   [ -d /usr/X11R6/share/X11/xkb/symbols/srvr_ctrl ]  return 1
+}
+
  rc_cmd $1



I haven't encountered the problem, but if xdm just failed I would be
somewhat surprised. Is there a useful message logged somewhere that would
indicate why xdm isn't starting? If there were such a message I think
this is a good idea.

 Ken


Try rereading what Stuart said.

--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.



Re: rc.d/xdm, check for broken xkb

2011-11-02 Thread Kenneth R Westerback
On Wed, Nov 02, 2011 at 08:42:15AM -0400, Brad wrote:
 On 02/11/11 8:31 AM, Kenneth R Westerback wrote:
 On Tue, Nov 01, 2011 at 04:39:29PM +, Stuart Henderson wrote:
 If you hit the xkb file/directory problem (for example, if you follow
 the upgrading without install kernel instructions), you can't type at
 the keyboard, even to switch to a text console.
 
 What does anyone think about disabling xdm if this brokenness is found?
 
 Index: xdm
 ===
 RCS file: /cvs/src/etc/rc.d/xdm,v
 retrieving revision 1.1
 diff -u -p -r1.1 xdm
 --- xdm 7 Jul 2011 18:42:17 -   1.1
 +++ xdm 1 Nov 2011 16:35:39 -
 @@ -6,4 +6,10 @@ daemon=/usr/X11R6/bin/xdm
 
   . /etc/rc.d/rc.subr
 
 +rc_pre() {
 +   # XXX Mitigate xkb mistake in 5.0, better not to run xdm than
 +   # leave a broken keyboard
 +   [ -d /usr/X11R6/share/X11/xkb/symbols/srvr_ctrl ]  return 1
 +}
 +
   rc_cmd $1
 
 
 I haven't encountered the problem, but if xdm just failed I would be
 somewhat surprised. Is there a useful message logged somewhere that would
 indicate why xdm isn't starting? If there were such a message I think
 this is a good idea.
 
  Ken
 
 Try rereading what Stuart said.

OK, I've re-read it. Still says the same thing. Keyboard non-functional.
I just tried to point out that the suggested solution might be
improved by ensuring an explanatory message is emitted or logged
somewhere so it would be obvious to me why xdm didn't start. And asked
if such a message were already emitted somewhere.

 Ken

 
 -- 
 This message has been scanned for viruses and
 dangerous content by MailScanner, and is
 believed to be clean.



Re: rc.d/xdm, check for broken xkb

2011-11-02 Thread Stefan Sperling
On Wed, Nov 02, 2011 at 08:31:19AM -0400, Kenneth R Westerback wrote:
 On Tue, Nov 01, 2011 at 04:39:29PM +, Stuart Henderson wrote:
  If you hit the xkb file/directory problem (for example, if you follow
  the upgrading without install kernel instructions), you can't type at
  the keyboard, even to switch to a text console. 
  
  What does anyone think about disabling xdm if this brokenness is found?
  
  Index: xdm
  ===
  RCS file: /cvs/src/etc/rc.d/xdm,v
  retrieving revision 1.1
  diff -u -p -r1.1 xdm
  --- xdm 7 Jul 2011 18:42:17 -   1.1
  +++ xdm 1 Nov 2011 16:35:39 -
  @@ -6,4 +6,10 @@ daemon=/usr/X11R6/bin/xdm
   
   . /etc/rc.d/rc.subr
   
  +rc_pre() {
  +   # XXX Mitigate xkb mistake in 5.0, better not to run xdm than
  +   # leave a broken keyboard
  +   [ -d /usr/X11R6/share/X11/xkb/symbols/srvr_ctrl ]  return 1
  +}
  +
   rc_cmd $1
  
 
 I haven't encountered the problem, but if xdm just failed I would be
 somewhat surprised. Is there a useful message logged somewhere that would
 indicate why xdm isn't starting? If there were such a message I think
 this is a good idea.

The script might as well try to fix the issue.

Index: xdm
===
RCS file: /cvs/src/etc/rc.d/xdm,v
retrieving revision 1.1
diff -u -p -r1.1 xdm
--- xdm 7 Jul 2011 18:42:17 -   1.1
+++ xdm 2 Nov 2011 12:54:26 -
@@ -6,4 +6,14 @@ daemon=/usr/X11R6/bin/xdm
 
 . /etc/rc.d/rc.subr
 
+pre_rc() {
+   # XXX Try to fix xkb mistake in 5.0
+   _symbols_dir=/usr/X11R6/share/X11/xkb/symbols
+   if [ -f ${_symbols_dir}/srvr_ctrl/srvr_ctrl ]; then
+   mv ${_symbols_dir}/srvr_ctrl ${_symbols_dir}/_srvr_ctrl
+   mv ${_symbols_dir}/_srvr_ctrl/srvr_ctrl ${_symbols_dir}
+   rmdir ${_symbols_dir}/_srvr_ctrl
+   fi
+}
+
 rc_cmd $1



Re: rc.d/xdm, check for broken xkb

2011-11-02 Thread Kenneth R Westerback
On Wed, Nov 02, 2011 at 02:00:47PM +0100, Stefan Sperling wrote:
 On Wed, Nov 02, 2011 at 08:31:19AM -0400, Kenneth R Westerback wrote:
  On Tue, Nov 01, 2011 at 04:39:29PM +, Stuart Henderson wrote:
   If you hit the xkb file/directory problem (for example, if you follow
   the upgrading without install kernel instructions), you can't type at
   the keyboard, even to switch to a text console. 
   
   What does anyone think about disabling xdm if this brokenness is found?
   
   Index: xdm
   ===
   RCS file: /cvs/src/etc/rc.d/xdm,v
   retrieving revision 1.1
   diff -u -p -r1.1 xdm
   --- xdm   7 Jul 2011 18:42:17 -   1.1
   +++ xdm   1 Nov 2011 16:35:39 -
   @@ -6,4 +6,10 @@ daemon=/usr/X11R6/bin/xdm

. /etc/rc.d/rc.subr

   +rc_pre() {
   + # XXX Mitigate xkb mistake in 5.0, better not to run xdm than
   + # leave a broken keyboard
   + [ -d /usr/X11R6/share/X11/xkb/symbols/srvr_ctrl ]  return 1
   +}
   +
rc_cmd $1
   
  
  I haven't encountered the problem, but if xdm just failed I would be
  somewhat surprised. Is there a useful message logged somewhere that would
  indicate why xdm isn't starting? If there were such a message I think
  this is a good idea.
 
 The script might as well try to fix the issue.
 
 Index: xdm
 ===
 RCS file: /cvs/src/etc/rc.d/xdm,v
 retrieving revision 1.1
 diff -u -p -r1.1 xdm
 --- xdm   7 Jul 2011 18:42:17 -   1.1
 +++ xdm   2 Nov 2011 12:54:26 -
 @@ -6,4 +6,14 @@ daemon=/usr/X11R6/bin/xdm
  
  . /etc/rc.d/rc.subr
  
 +pre_rc() {
 + # XXX Try to fix xkb mistake in 5.0
 + _symbols_dir=/usr/X11R6/share/X11/xkb/symbols
 + if [ -f ${_symbols_dir}/srvr_ctrl/srvr_ctrl ]; then
 + mv ${_symbols_dir}/srvr_ctrl ${_symbols_dir}/_srvr_ctrl
 + mv ${_symbols_dir}/_srvr_ctrl/srvr_ctrl ${_symbols_dir}
 + rmdir ${_symbols_dir}/_srvr_ctrl
 + fi
 +}
 +
  rc_cmd $1

Even better.

 Ken



Re: rc.d/xdm, check for broken xkb

2011-11-02 Thread Brad

On 02/11/11 8:59 AM, Kenneth R Westerback wrote:

On Wed, Nov 02, 2011 at 08:42:15AM -0400, Brad wrote:

On 02/11/11 8:31 AM, Kenneth R Westerback wrote:

On Tue, Nov 01, 2011 at 04:39:29PM +, Stuart Henderson wrote:

If you hit the xkb file/directory problem (for example, if you follow
the upgrading without install kernel instructions), you can't type at
the keyboard, even to switch to a text console.

What does anyone think about disabling xdm if this brokenness is found?

Index: xdm
===
RCS file: /cvs/src/etc/rc.d/xdm,v
retrieving revision 1.1
diff -u -p -r1.1 xdm
--- xdm 7 Jul 2011 18:42:17 -   1.1
+++ xdm 1 Nov 2011 16:35:39 -
@@ -6,4 +6,10 @@ daemon=/usr/X11R6/bin/xdm

  . /etc/rc.d/rc.subr

+rc_pre() {
+   # XXX Mitigate xkb mistake in 5.0, better not to run xdm than
+   # leave a broken keyboard
+   [ -d /usr/X11R6/share/X11/xkb/symbols/srvr_ctrl ]   return 1
+}
+
  rc_cmd $1



I haven't encountered the problem, but if xdm just failed I would be
somewhat surprised. Is there a useful message logged somewhere that would
indicate why xdm isn't starting? If there were such a message I think
this is a good idea.

 Ken


Try rereading what Stuart said.


OK, I've re-read it. Still says the same thing. Keyboard non-functional.
I just tried to point out that the suggested solution might be
improved by ensuring an explanatory message is emitted or logged
somewhere so it would be obvious to me why xdm didn't start. And asked
if such a message were already emitted somewhere.

 Ken


Sorry about that. I had interpreted what you initially said differently.
Your suggestion sounds good if going with Stuart's proposed diff.

--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.



Re: rc.d/xdm, check for broken xkb

2011-11-02 Thread Brad

On 02/11/11 9:00 AM, Stefan Sperling wrote:

On Wed, Nov 02, 2011 at 08:31:19AM -0400, Kenneth R Westerback wrote:

On Tue, Nov 01, 2011 at 04:39:29PM +, Stuart Henderson wrote:

If you hit the xkb file/directory problem (for example, if you follow
the upgrading without install kernel instructions), you can't type at
the keyboard, even to switch to a text console.

What does anyone think about disabling xdm if this brokenness is found?

Index: xdm
===
RCS file: /cvs/src/etc/rc.d/xdm,v
retrieving revision 1.1
diff -u -p -r1.1 xdm
--- xdm 7 Jul 2011 18:42:17 -   1.1
+++ xdm 1 Nov 2011 16:35:39 -
@@ -6,4 +6,10 @@ daemon=/usr/X11R6/bin/xdm

  . /etc/rc.d/rc.subr

+rc_pre() {
+   # XXX Mitigate xkb mistake in 5.0, better not to run xdm than
+   # leave a broken keyboard
+   [ -d /usr/X11R6/share/X11/xkb/symbols/srvr_ctrl ]  return 1
+}
+
  rc_cmd $1



I haven't encountered the problem, but if xdm just failed I would be
somewhat surprised. Is there a useful message logged somewhere that would
indicate why xdm isn't starting? If there were such a message I think
this is a good idea.


The script might as well try to fix the issue.

Index: xdm
===
RCS file: /cvs/src/etc/rc.d/xdm,v
retrieving revision 1.1
diff -u -p -r1.1 xdm
--- xdm 7 Jul 2011 18:42:17 -   1.1
+++ xdm 2 Nov 2011 12:54:26 -
@@ -6,4 +6,14 @@ daemon=/usr/X11R6/bin/xdm

  . /etc/rc.d/rc.subr

+pre_rc() {
+   # XXX Try to fix xkb mistake in 5.0
+   _symbols_dir=/usr/X11R6/share/X11/xkb/symbols
+   if [ -f ${_symbols_dir}/srvr_ctrl/srvr_ctrl ]; then
+   mv ${_symbols_dir}/srvr_ctrl ${_symbols_dir}/_srvr_ctrl
+   mv ${_symbols_dir}/_srvr_ctrl/srvr_ctrl ${_symbols_dir}
+   rmdir ${_symbols_dir}/_srvr_ctrl
+   fi
+}
+
  rc_cmd $1


This looks like a better option.


--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.



Re: rc.d/xdm, check for broken xkb

2011-11-02 Thread Stuart Henderson
On 2011/11/02 14:00, Stefan Sperling wrote:
 On Wed, Nov 02, 2011 at 08:31:19AM -0400, Kenneth R Westerback wrote:
  On Tue, Nov 01, 2011 at 04:39:29PM +, Stuart Henderson wrote:
   If you hit the xkb file/directory problem (for example, if you follow
   the upgrading without install kernel instructions), you can't type at
   the keyboard, even to switch to a text console. 
   
   What does anyone think about disabling xdm if this brokenness is found?
   
   Index: xdm
   ===
   RCS file: /cvs/src/etc/rc.d/xdm,v
   retrieving revision 1.1
   diff -u -p -r1.1 xdm
   --- xdm   7 Jul 2011 18:42:17 -   1.1
   +++ xdm   1 Nov 2011 16:35:39 -
   @@ -6,4 +6,10 @@ daemon=/usr/X11R6/bin/xdm

. /etc/rc.d/rc.subr

   +rc_pre() {
   + # XXX Mitigate xkb mistake in 5.0, better not to run xdm than
   + # leave a broken keyboard
   + [ -d /usr/X11R6/share/X11/xkb/symbols/srvr_ctrl ]  return 1
   +}
   +
rc_cmd $1
   
  
  I haven't encountered the problem, but if xdm just failed I would be
  somewhat surprised. Is there a useful message logged somewhere that would
  indicate why xdm isn't starting? If there were such a message I think
  this is a good idea.

I'm not convinced anyone would find it in logs, a message on screen
would be more obvious but stdout and stderr are redirected to /dev/null
in rc_pre, so it's hard to print anything.

 The script might as well try to fix the issue.

 Index: xdm
 ===
 RCS file: /cvs/src/etc/rc.d/xdm,v
 retrieving revision 1.1
 diff -u -p -r1.1 xdm
 --- xdm   7 Jul 2011 18:42:17 -   1.1
 +++ xdm   2 Nov 2011 12:54:26 -
 @@ -6,4 +6,14 @@ daemon=/usr/X11R6/bin/xdm
  
  . /etc/rc.d/rc.subr
  
 +pre_rc() {
 + # XXX Try to fix xkb mistake in 5.0
 + _symbols_dir=/usr/X11R6/share/X11/xkb/symbols
 + if [ -f ${_symbols_dir}/srvr_ctrl/srvr_ctrl ]; then
 + mv ${_symbols_dir}/srvr_ctrl ${_symbols_dir}/_srvr_ctrl
 + mv ${_symbols_dir}/_srvr_ctrl/srvr_ctrl ${_symbols_dir}
 + rmdir ${_symbols_dir}/_srvr_ctrl
 + fi
 +}
 +
  rc_cmd $1

I think that actually fixing it is beyond the remit of these scripts,
also this would leave you with an incorrect srvr_ctrl file (the file
from the new xkeyboard-config is a bit different to the old one).

Anyway following some offlist mail I decided to drop this diff..



rc.d/xdm, check for broken xkb

2011-11-01 Thread Stuart Henderson
If you hit the xkb file/directory problem (for example, if you follow
the upgrading without install kernel instructions), you can't type at
the keyboard, even to switch to a text console. 

What does anyone think about disabling xdm if this brokenness is found?

Index: xdm
===
RCS file: /cvs/src/etc/rc.d/xdm,v
retrieving revision 1.1
diff -u -p -r1.1 xdm
--- xdm 7 Jul 2011 18:42:17 -   1.1
+++ xdm 1 Nov 2011 16:35:39 -
@@ -6,4 +6,10 @@ daemon=/usr/X11R6/bin/xdm
 
 . /etc/rc.d/rc.subr
 
+rc_pre() {
+   # XXX Mitigate xkb mistake in 5.0, better not to run xdm than
+   # leave a broken keyboard
+   [ -d /usr/X11R6/share/X11/xkb/symbols/srvr_ctrl ]  return 1
+}
+
 rc_cmd $1