Bypassing the Visual Login Screen
#1
Bypassing the Visual Login Screen
Hello! I've got a bit of an edge case here, today, but I'm curious if anyone here has a clever solution to my issue.

I currently have my Onyx4 set up beside my desk, with a monitor located near my primary PC workstation. My usual start-up procedure for the system is as follows: I send the power on command to the SGI via a serial terminal, boot it up, then I have to plug a keyboard into the SGI just to type the login info by hand. If I attempt to log into the system via serial, I can get into a shell prompt, but I still need to use a separate keyboard in order to get past the login screen.

Once IRIX is at a desktop, I can launch the nekoware Synergy client and then interact with the system with my normal PC peripherals. It works great once the system is booted, but Synergy cannot interact with the GUI login screen in any meaningful fashion, even when started via the serial connection.

Any ideas? In a perfect situation, I'd love to have the machine boot up, accept a serial login, then throw me into a desktop IRIX environment with Synergy either running or ready to run. Hoping there's a feasible way to do so, heh.
CiaoTime
Unregistered

Trade Count: (0)
 
Reply
12-20-2018, 12:46 PM
#2
RE: Bypassing the Visual Login Screen
This has been done before and i did have it implemented. The howto was on Nekochan and i've been trying to get that instruction back ever since.

Basically you need to start synergy with the help of the Xsession file and/or gdm file to get synergy working at the graphical login stage when the system has finished booting. Then after successful login with your keyboard and mouse mapped via synergy the current synergy will stop and a new synergy will start at your desktop.

If anyone has that howto do share it.

UPDATE:
I haven't found the howto but i have found copies of the relevant files on my build machine. This needs testing if this actually works but in any case i can share the files in here. I don't think it's wise to copy them 1:1 , you should prune them and compare them with your current files to find out what needs changing. For instance, my synergy server is called "link", you need to change that to your synergy server.

Xsession
Code:
#!/bin/sh

# Based on: $XConsortium: Xsession,v 1.7 92/08/06 11:08:14 gildea Exp $

# The following lines configure synergy and allow the keyboard and mouse
# to be controlled over TCP/IP from another system running as a synergy
# server.  Synergy is started by the display manager through the Xlogin
# file.  When the user logs in this instance of synergy is killed through
# the Xstartup file.  Lastly a new session of syenergy is started for the
# user through this file.  Change the hostname in the third line if the
# synergy server changes.
#/usr/nekoware/bin/synergyc
sleep 1
/usr/nekoware/bin/synergyc --daemon --restart link

# Desktop addition.  If there is a Xsession.dt file, execute that instead
if /etc/chkconfig desktop ;
then
    if [ -x $0.dt -a \! -f $HOME/.disableDesktop -a -w $HOME ]
    then
        exec $0.dt $*
    fi
fi

# # Uncomment this for X11R5 redirection of Xsession errors.
#
# # redirect errors to a file in user's home directory if we can
# for errfile in "$HOME/.xsession-errors" "/tmp/xses-$USER"
# do
#         if ( cp /dev/null "$errfile" 2> /dev/null )
#         then
#                 chmod 600 "$errfile"
#                 exec > "$errfile" 2>&1
#                 break
#         fi
# done

case $# in
1)
    case $1 in
    failsafe)
        dim="`xdpyinfo | awk ' /dimensions/ {print $2}' | grep '1024x768'`"
        if [ "$?" = 0 ]; then
        geom="80x40+190+102"
        font="-sgi-terminal-*-*-*--12-*"
        else
        geom="80x40+150+172"
        font="-sgi-terminal-*-*-*--17-*"
        fi
        exec xwsh -geom $geom -fn $font -xrm "XWsh.autoFork: off" -nomenu
        ;;
    esac
esac

xsession=$HOME/.xsession
resources=$HOME/.Xresources
sgisession=$HOME/.sgisession
userenv=/usr/bin/X11/userenv
homechestrc=$HOME/.chestrc

lang=$HOME/.lang

if [ -r $xsession -a "$0" != $xsession ]; then
    if [ -x $xsession ]; then
        exec $xsession
    else
        exec /bin/sh $xsession
    fi
fi

# Set the users language
if [ -r $lang -a -f $lang ] ; then LANG=`cat $lang`; export LANG; fi

if [ -r $resources ]; then
    xrdb -load -quiet $resources
fi

# This is the pre-IRIX 5.3 setting of XUSERFILESEARCHPATH
# XUSERFILESEARCHPATH="$HOME/%N:`/usr/bin/X11/appdefpath`"
# export XUSERFILESEARCHPATH
# In IRIX 5.3, we don't set XUSERFILESEARCHPATH anymore.

if [ -x $userenv ]; then
    #
    # Find user's environment as set up during a login
    #  shell, and add that to current environment.
    #
    eval `$userenv`
fi

screens=`/usr/bin/X11/xlistscrns`

# Gives anyone on any host access to this display
# /usr/bin/X11/xhost +

#
# Note: Output from $HOME/.sgisession, 4Dwm and toolchest
# is redirected to /dev/console. All other output is written to
# /usr/adm/SYSLOG by default (or where the X11R5 redirection makes it go
# if the above X11R5 redirection lines above are uncommented).
#

#
# Do language dependent stuff
intlenv=`gettxt uxsgidesktop:452 ':'`
eval ${intlenv}

/usr/bin/X11/4Dwm >/dev/console 2>&1 &
/usr/bin/X11/wait4wm

/usr/sbin/startconsole -iconic

if [ -x $sgisession ]; then
    $sgisession >/dev/console 2>&1 &
elif [ -r $sgisession ]; then
    /bin/sh $sgisession >/dev/console 2>&1 &
fi

if [ -r $homechestrc ]; then
    chestrc=$HOME/.chestrc
else
    chestrc=/usr/lib/X11/nodesktop.chestrc
fi

for screen in $screens
  do
  DISPLAY=$screen /usr/bin/X11/toolchest -name ToolChest $chestrc >/dev/console 2>&1 &
  done

exec /usr/bin/X11/reaper

Xlogin
Code:
#!/bin/sh
# /usr/bin/X11/xsetroot -bg sgilightblue -bitmap /usr/include/X11/bitmaps/grainy

# The following lines configure synergy and allow the keyboard and mouse
# to be controlled over TCP/IP from another system running as a synergy
# server.  Change the hostname in the third line if the synergy server
# changes.  Synergy is started by the display manager through this file
# at system start.  When the user logs in this instance of synergy is
# killed through the Xstartup file.  Lastly a new session of syenergy
# is started for the user through the Xsession file.
# /usr/nekoware/bin/synergyc
sleep 1
/usr/nekoware/bin/synergyc --daemon --restart link

dpy=`echo $DISPLAY | sed -e 's/.*://' -e 's/\..*$//'`
XAUTHORITY=/usr/lib/X11/xdm/xdm-auth-$dpy export XAUTHORITY

#
# CAUTION:
# These two lines need to match those in /usr/bin/X11/X.
# NOT configurable on a per-user basis.
#
glGammaFile=/etc/config/system.glGammaVal
glGammaDefault="1.7"
GAMMA_CMD=/usr/sbin/gamma

#
# Execute gamma only for REX (starter) graphics.
#
if `hinv -c graphics | fgrep -s LG1` && [ -x "$GAMMA_CMD" ]; then
    RUN_GAMMA=1
fi

if [ "$RUN_GAMMA" = 1 ]; then
    if [ -r $glGammaFile -a -s $glGammaFile ];  then
        glGammaVal=`cat $glGammaFile`
    else
        glGammaVal=$glGammaDefault
    fi
fi

screens=`/usr/bin/X11/xlistscrns`
for screen in $screens
    do
    if [ "$RUN_GAMMA" = 1 ]; then
        HOME=/ DISPLAY=$screen /usr/sbin/gamma $glGammaVal
    fi
    done

/usr/bin/X11/xlistscrns -i

# The following lines configure screen saving when the user is logged out.
# The first numerical parameter sets the blank interval to 10 minutes, the
# second numerical parameter sets the power save interval to 20 minutes.
# The power save interval is ignored if the X server does not think that the
# monitor supports power save.
# See the xset man page for more details.
#
if [ -x /usr/bin/X11/xset ] ; then
    /usr/bin/X11/xset s 600 1200
fi

if [ -x /usr/X11R6/bin/XFree86 ]; then
for screen in $screens
   do
      if [ -x /usr/bin/X11/xsetroot ]; then
         /usr/bin/X11/xsetroot -display $screen -fg sgilightblue -mod 1 1
      fi
   done
fi

# visuallogin:  on: clogin;                  off: plain xdm login
# also, "-f" in clogin means grab input focus
if /etc/chkconfig visuallogin ; then
    if [ -x /usr/Cadmin/bin/clogin ] ; then
        exec /usr/Cadmin/bin/clogin -f $1
    fi
fi

Xstartup
Code:
#!/bin/sh
#
# Xstartup
#
# This program is run as root after the user is verified
#
# don't do xstdcmap until its fixed
# nohup /usr/bin/X11/xstdcmap -all &

# The following lines configure synergy and allow the keyboard and mouse
# to be controlled over TCP/IP from another system running as a synergy
# server.  Synergy is started by the display manager through the Xlogin
# file.  When the user logs in this instance of synergy is killed through
# this file.  Lastly a new session of syenergy is started for the user
# through the Xsession file.
/etc/killall synergyc
sleep 1

#
# CAUTION:
# These two lines need to match those in /usr/bin/X11/X.
# NOT configurable on a per-user basis.
#
glGammaFile=/etc/config/system.glGammaVal
glGammaDefault="1.7"
GAMMA_CMD=/usr/sbin/gamma

#
# Execute gamma only for REX (starter) graphics.
#
if `hinv -c graphics | fgrep -s LG1` && [ -x "$GAMMA_CMD" ]; then
    RUN_GAMMA=1
fi

if [ "$RUN_GAMMA" = 1 ]; then
    if [ -r $glGammaFile -a -s $glGammaFile ];  then
        glGammaVal=`cat $glGammaFile`
    else
        glGammaVal=$glGammaDefault
    fi

    screens=`/usr/bin/X11/xlistscrns`
    for screen in $screens
        do
        HOME=/ DISPLAY=$screen /usr/sbin/gamma $glGammaVal
        done
fi

#
# Set the permissions of /dev/mvp so only the console user has access
#
if [ -r /dev/mvp ]; then
    chown $USER /dev/mvp
    chmod 600 /dev/mvp
fi


#
# Tell xdm everything is ok
#
exit 0
UPDATE #2: it's a wiki page at https://wiki.preterhuman.net/Synergy   Yay!
(This post was last modified: 12-20-2018, 06:00 PM by dexter1.)
dexter1
Administrator

Trade Count: (1)
Posts: 297
Threads: 17
Joined: May 2018
Location: The Netherlands
Find Reply
12-20-2018, 05:30 PM
#3
RE: Bypassing the Visual Login Screen
Thank you! That wiki page has definitely helped me make some progress, though now I'm running into an unexpected issue. Synergy now runs during the visual login screen, and I can interact with it at full capacity: however, the moment I attempt to log in as any user, the display goes blank for a few seconds and then kicks me back to the login prompt.

Commenting out every single line that I'd added except for the one that starts the initial Synergy client does not solve the issue.

Still, it's encouraging to see that I'm at least on the right track. Any other ideas? I'm not even sure how to troubleshoot it: I'd taken a quick look through the massively verbose X server log (/var/log/XFree86.0.log on this machine), but hadn't seen any obviously related errors during my browse in there.

Can make a video tomorrow if demonstrating the issue helps any.
CiaoTime
Unregistered

Trade Count: (0)
 
Reply
12-21-2018, 02:13 AM
#4
RE: Bypassing the Visual Login Screen
Bumping this topic since I've yet to find a fix for this issue, and have yet to figure out where to start troubleshooting it. Here's the video:

<iframe width="560" height="315" src="https://www.youtube.com/embed/qASV8Hd-OGk" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
CiaoTime
Unregistered

Trade Count: (0)
 
Reply
12-24-2018, 11:59 PM
#5
RE: Bypassing the Visual Login Screen
Guys, i've figured it out.

You need an older synergy version from here: http://fr.irisware.net/nekoware/obsolete....1.tardist

The 1.4.2 client somehow fails to properly finish the Xstartup sequence. With the 1.3.1 client i can get a succesful synergy connection with the Visual login window and upon login the Xstartup kills the first Synergy and Xsession starts the user synergy client.

You don't have to install the whole nekoware package, just do
Code:
showfiles -f . -x -- synergyc
and copy the binary in /usr/nekoware/bin

I've made some small tweaks to my Xlogin and Xstartup files:
Xsession
Code:
#!/bin/sh

# Based on: $XConsortium: Xsession,v 1.7 92/08/06 11:08:14 gildea Exp $

# The following lines configure synergy and allow the keyboard and mouse
# to be controlled over TCP/IP from another system running as a synergy
# server.  Synergy is started by the display manager through the Xlogin
# file.  When the user logs in this instance of synergy is killed through
# the Xstartup file.  Lastly a new session of syenergy is started for the
# user through this file.  Change the hostname in the third line if the
# synergy server changes.
#/usr/nekoware/bin/synergyc
sleep 1
/usr/nekoware/bin/synergyc --daemon --restart biolink

# Desktop addition.  If there is a Xsession.dt file, execute that instead
if /etc/chkconfig desktop ;
then
    if [ -x $0.dt -a \! -f $HOME/.disableDesktop -a -w $HOME ]
    then
        exec $0.dt $*
    fi
fi

# # Uncomment this for X11R5 redirection of Xsession errors.
#
# # redirect errors to a file in user's home directory if we can
# for errfile in "$HOME/.xsession-errors" "/tmp/xses-$USER"
# do
#         if ( cp /dev/null "$errfile" 2> /dev/null )
#         then
#                 chmod 600 "$errfile"
#                 exec > "$errfile" 2>&1
#                 break
#         fi
# done

case $# in
1)
    case $1 in
    failsafe)
        dim="`xdpyinfo | awk ' /dimensions/ {print $2}' | grep '1024x768'`"
        if [ "$?" = 0 ]; then
        geom="80x40+190+102"
        font="-sgi-terminal-*-*-*--12-*"
        else
        geom="80x40+150+172"
        font="-sgi-terminal-*-*-*--17-*"
        fi
        exec xwsh -geom $geom -fn $font -xrm "XWsh.autoFork: off" -nomenu
        ;;
    esac
esac

xsession=$HOME/.xsession
resources=$HOME/.Xresources
sgisession=$HOME/.sgisession
userenv=/usr/bin/X11/userenv
homechestrc=$HOME/.chestrc

lang=$HOME/.lang

if [ -r $xsession -a "$0" != $xsession ]; then
    if [ -x $xsession ]; then
        exec $xsession
    else
        exec /bin/sh $xsession
    fi
fi

# Set the users language
if [ -r $lang -a -f $lang ] ; then LANG=`cat $lang`; export LANG; fi

if [ -r $resources ]; then
    xrdb -load -quiet $resources
fi

# This is the pre-IRIX 5.3 setting of XUSERFILESEARCHPATH
# XUSERFILESEARCHPATH="$HOME/%N:`/usr/bin/X11/appdefpath`"
# export XUSERFILESEARCHPATH
# In IRIX 5.3, we don't set XUSERFILESEARCHPATH anymore.

if [ -x $userenv ]; then
    #
    # Find user's environment as set up during a login
    #  shell, and add that to current environment.
    #
    eval `$userenv`
fi

screens=`/usr/bin/X11/xlistscrns`

# Gives anyone on any host access to this display
# /usr/bin/X11/xhost +

#
# Note: Output from $HOME/.sgisession, 4Dwm and toolchest
# is redirected to /dev/console. All other output is written to
# /usr/adm/SYSLOG by default (or where the X11R5 redirection makes it go
# if the above X11R5 redirection lines above are uncommented).
#

#
# Do language dependent stuff
intlenv=`gettxt uxsgidesktop:452 ':'`
eval ${intlenv}

/usr/bin/X11/4Dwm >/dev/console 2>&1 &
/usr/bin/X11/wait4wm

/usr/sbin/startconsole -iconic

if [ -x $sgisession ]; then
    $sgisession >/dev/console 2>&1 &
elif [ -r $sgisession ]; then
    /bin/sh $sgisession >/dev/console 2>&1 &
fi

if [ -r $homechestrc ]; then
    chestrc=$HOME/.chestrc
else
    chestrc=/usr/lib/X11/nodesktop.chestrc
fi

for screen in $screens
  do
  DISPLAY=$screen /usr/bin/X11/toolchest -name ToolChest $chestrc >/dev/console 2>&1 &
  done

exec /usr/bin/X11/reaper

Xlogin
Code:
#!/bin/sh
# /usr/bin/X11/xsetroot -bg sgilightblue -bitmap /usr/include/X11/bitmaps/grainy

# The following lines configure synergy and allow the keyboard and mouse
# to be controlled over TCP/IP from another system running as a synergy
# server.  Change the hostname in the third line if the synergy server
# changes.  Synergy is started by the display manager through this file
# at system start.  When the user logs in this instance of synergy is
# killed through the Xstartup file.  Lastly a new session of syenergy
# is started for the user through the Xsession file.
/sbin/killall synergyc
sleep 1
/usr/nekoware/bin/synergyc --daemon --restart biolink

dpy=`echo $DISPLAY | sed -e 's/.*://' -e 's/\..*$//'`
XAUTHORITY=/usr/lib/X11/xdm/xdm-auth-$dpy export XAUTHORITY

#
# CAUTION:
# These two lines need to match those in /usr/bin/X11/X.
# NOT configurable on a per-user basis.
#
glGammaFile=/etc/config/system.glGammaVal
glGammaDefault="1.7"
GAMMA_CMD=/usr/sbin/gamma

#
# Execute gamma only for REX (starter) graphics.
#
if `hinv -c graphics | fgrep -s LG1` && [ -x "$GAMMA_CMD" ]; then
    RUN_GAMMA=1
fi

if [ "$RUN_GAMMA" = 1 ]; then
    if [ -r $glGammaFile -a -s $glGammaFile ];  then
        glGammaVal=`cat $glGammaFile`
    else
        glGammaVal=$glGammaDefault
    fi
fi

screens=`/usr/bin/X11/xlistscrns`
for screen in $screens
    do
    if [ "$RUN_GAMMA" = 1 ]; then
        HOME=/ DISPLAY=$screen /usr/sbin/gamma $glGammaVal
    fi
    done

/usr/bin/X11/xlistscrns -i

# The following lines configure screen saving when the user is logged out.
# The first numerical parameter sets the blank interval to 10 minutes, the
# second numerical parameter sets the power save interval to 20 minutes.
# The power save interval is ignored if the X server does not think that the
# monitor supports power save.
# See the xset man page for more details.
#
if [ -x /usr/bin/X11/xset ] ; then
    /usr/bin/X11/xset s 600 1200
fi

if [ -x /usr/X11R6/bin/XFree86 ]; then
for screen in $screens
   do
      if [ -x /usr/bin/X11/xsetroot ]; then
         /usr/bin/X11/xsetroot -display $screen -fg sgilightblue -mod 1 1
      fi
   done
fi

# visuallogin:  on: clogin;                  off: plain xdm login
# also, "-f" in clogin means grab input focus
if /etc/chkconfig visuallogin ; then
    if [ -x /usr/Cadmin/bin/clogin ] ; then
        exec /usr/Cadmin/bin/clogin -f $1
    fi
fi

Xstartup
Code:
#!/bin/sh
#
# Xstartup
#
# This program is run as root after the user is verified
#
# don't do xstdcmap until its fixed
# nohup /usr/bin/X11/xstdcmap -all &

# The following lines configure synergy and allow the keyboard and mouse
# to be controlled over TCP/IP from another system running as a synergy
# server.  Synergy is started by the display manager through the Xlogin
# file.  When the user logs in this instance of synergy is killed through
# this file.  Lastly a new session of syenergy is started for the user
# through the Xsession file.
/sbin/killall synergyc
sleep 1

#
# CAUTION:
# These two lines need to match those in /usr/bin/X11/X.
# NOT configurable on a per-user basis.
#
glGammaFile=/etc/config/system.glGammaVal
glGammaDefault="1.7"
GAMMA_CMD=/usr/sbin/gamma

#
# Execute gamma only for REX (starter) graphics.
#
if `hinv -c graphics | fgrep -s LG1` && [ -x "$GAMMA_CMD" ]; then
    RUN_GAMMA=1
fi

if [ "$RUN_GAMMA" = 1 ]; then
    if [ -r $glGammaFile -a -s $glGammaFile ];  then
        glGammaVal=`cat $glGammaFile`
    else
        glGammaVal=$glGammaDefault
    fi

    screens=`/usr/bin/X11/xlistscrns`
    for screen in $screens
        do
        HOME=/ DISPLAY=$screen /usr/sbin/gamma $glGammaVal
        done
fi

#
# Set the permissions of /dev/mvp so only the console user has access
#
if [ -r /dev/mvp ]; then
    chown $USER /dev/mvp
    chmod 600 /dev/mvp
fi

#
# Tell xdm everything is ok
#
exit 0
dexter1
Administrator

Trade Count: (1)
Posts: 297
Threads: 17
Joined: May 2018
Location: The Netherlands
Find Reply
01-20-2019, 08:56 PM
#6
Thumbs Up  RE: Bypassing the Visual Login Screen
(01-20-2019, 08:56 PM)dexter1 Wrote:  Guys, i've figured it out.

You did! Synergy 1.3.1 worked on the system on the login screen and on the desktop, first try. Brilliant work, thank you!
CiaoTime
Unregistered

Trade Count: (0)
 
Reply
01-22-2019, 04:56 AM
#7
RE: Bypassing the Visual Login Screen
Sweet! Thanks Dexter. I've been looking for this.

O2 Fuel
s0ke
O2

Trade Count: (1)
Posts: 29
Threads: 6
Joined: Jul 2020
Find Reply
09-04-2020, 03:43 PM


Forum Jump:


Users browsing this thread: 1 Guest(s)