tech-x11 archive

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

Re: xconsole/getty 7_BETA



Ok, so this is a sub-optimal solution.  Perhaps it will give someone a better idea.  It's single positive aspect is that it works.  From an elegance perspective it sucks.  In private correspondence, it was suggested that turning off console is a bad idea.  That notion is agreeable.  One certain bug is that, if the user switches to ttyE0 and runs /etc/rc.d/xdm stop he gets logged out.

--------/etc/rc.d/xdm---------------
#!/bin/sh
#
# $NetBSD: xdm.in,v 1.1 2008/12/05 18:55:22 cube Exp $
#

# PROVIDE: xdm
# REQUIRE: DAEMON LOGIN wscons
# KEYWORD: shutdown

$_rc_subr_loaded . /etc/rc.subr

name="xdm"
rcvar=$name
command="/usr/X11R7/bin/${name}"
start_precmd="xdm_prestart"
stop_postcmd="xdm_poststop"
pidfile="/var/run/${name}.pid"
required_files="/etc/X11/xdm/xdm-config"
extra_commands="reload"

xdm_prestart()
{
        local ttyE0_on='/^ttyE0/ s/off /on /'
        local console_off='/^console/ s/on /off /'
        local sed_cmd="$console_off;$ttyE0_on"
        sed -i -e "$sed_cmd" /etc/ttys
        kill -HUP 1
        return 0
}

xdm_poststop()
{
        local ttyE0_off='/^ttyE0/ s/on /off /'
        local console_on='/^console/ s/off /on /'
        local sed_cmd="$console_on;$ttyE0_off"
        sed -i -e "$sed_cmd" /etc/ttys
        kill -HUP 1
        return 0
}

load_rc_config $name
run_rc_command "$1"


On Mon, Feb 23, 2015 at 8:18 AM, Phillip Rulon <prulon%gmail.com@localhost> wrote:
After a few private volleys with knowledgeable people, the suggestion was made that this be brought back to the list.

To recap the behavior:

If xdm is specified in sysinst, getty and xconsole argue over who's got the console.  /var/log/wtmpx fills up unusually fast and xconsole cycles getty login output about every 30 seconds.  If xconsole is shut off the behavior goes away.  If console is shutoff in /etc/ttys, the behavior goes away.

A possible fix is to have custom start/stop routines in /etc/rc.d/xdm which mod the ttys file and HUP init.  Hopefully a more elegant solution can be found.

# uname -a
NetBSD hakr.zephyrite.net 7.0_BETA NetBSD 7.0_BETA (GENERIC.201502171530Z) i386

To reproduce the behavior, a stock 7.0_BETA install can be done on a naked machine, specifying xdm to sysinst.  After the first reboot, monitor xconsole and the size growth of /var/log/wtmpx.

The test machine is i386, though it's doubtful that the behavior is isolated to this port.

/pjr\




Home | Main Index | Thread Index | Old Index