source: src-qt4/PCDM/PCDMd @ d5549e0

9.2-releasereleng/10.0releng/10.0.1releng/10.0.2
Last change on this file since d5549e0 was d5549e0, checked in by Ken Moore <ken@…>, 9 months ago

Move the xauth commands to when the xserver is not currently running and see if this lets it work

  • Property mode set to 100755
File size: 1.4 KB
Line 
1#!/bin/sh
2# Login daemon for PCDM
3# This listens for system login prompts and starts the main PCDM UI appropriately
4#------------------------------------
5
6PCDMCONF="/usr/local/etc/pcdm.conf"
7PCDMAUTHFILE="/tmp/.PCDMAuth"
8
9XOPTS=""
10grep -q "^ENABLE_TCP_LISTEN=TRUE" ${PCDMCONF}
11if [ $? -ne 0 ]; then
12  XOPTS="-nolisten tcp" 
13fi
14
15#See if VNC support is enabled for logging in to this system
16grep -q "^ALLOW_REMOTE_LOGIN=TRUE" ${PCDMCONF}
17if [ $? -eq 0 ]; then
18   # Setup default vnc server opts
19   vncopts="-forever "
20   grep -q "^REMOTE_SHARED_SCREEN=TRUE" ${PCDMCONF}
21   if [ $? -eq 0 ] ; then
22     vncopts="-shared "
23   else
24     vncopts="-nevershared "
25   fi
26   if [ -e "/usr/local/etc/vncpass" ] ; then
27     vnccmd="x11vnc -display :0 $vncopts -passwdfile /usr/local/etc/vncpass"
28   else
29     echo "WARNING: VNC enabled but no password in /usr/local/etc/vncpass!"
30     sleep 5
31   fi
32
33fi
34
35
36# Allow Auto-Login the first time PCDM starts
37touch /tmp/.PCDMAutoLogin
38# Make sure the authorization file exists
39touch ${PCDMAUTHFILE}
40# Now start the X Server
41while [ ! -e /var/run/nologin ]; do
42  /usr/local/bin/pc-checkxdisplay
43
44  if [ -n "$vnccmd" ] ; then
45    # Start VNC
46    (sleep 10 ; $vnccmd >/var/log/vncserver 2>/var/log/vncserver) &
47  fi
48  setenv XAUTHORITY ${PCDMAUTHFILE}
49  xauth -f ${PCDMAUTHFILE} generate :0 .
50  xinit /usr/local/bin/PCDM-session --once -- :0 -auth ${PCDMAUTHFILE} $XOPTS
51  xauth -f ${PCDMAUTHFILE} remove :0
52done
Note: See TracBrowser for help on using the repository browser.