Problem
I would like to start an X server and application remotely on an
Openserver system. In other words, I want to run an X application
and display it on OpenServer, but I wish to carry this out from
another, remote, system. Solution
The following script will allow you to start an X server and an application and have all the events logged to /tmp/xserv.log.
#!/bin/sh
:# Log everything to the log file below
exec 1<&- > /tmp/xserv.log 2>&1# Set the PATH to include the X Directory and define the app to run
PATH=${PATH}:/usr/bin/X11 export PATH
DISPLAY=:0 export DISPLAY
APP=/usr/bin/X11/xclock
APPARGS="-bg yellow -fg blue -geometry 800x600"
XTTYNUM=02# In background ensure the getty is disabled for XTTYNUM, allow time
# for it to finish, use the echo command to switch to that screen,
# start the application. Press ALT-SYSREQ on the console to exit it,
# then allow time to finish then re-enable the getty. ( disable tty${XTTYNUM} ; \
sleep 2 ; \
echo "\033[`expr ${XTTYNUM} - 1`z\c" > /dev/console ; \
/usr/bin/X11/xinit ${APP} ${APPARGS} -- -crt /dev/tty${XTTYNUM}
$(DISPLAY} ; \
sleep 2 ; \
enable tty${XTTYNUM} ; ) &exit 0NOTE: It is assumed that:a) no other X server is running on the server. b) you have access to "rcmd" or "rsh" onto the server. c) the script is held in /local/start.x.app and is ran with the command:
# rcmd <server> /local/start.x.appd) localhost is defined in /etc/X0.hosts. e) you have run "scologin disable" before starting.
See also
TA107582, "OpenServer 5, rcmd fails with "Permission denied" or rlogin requires a password."
TA107437, "rcmd appears to hang when running daemon programs on remote system"