source: src-qt4/PCDM/PCDMd @ ef691e9

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

Make sure to specify the auth file for the xauth command in PCDMd

  • Property mode set to 100755
File size: 1.6 KB
Line 
1#!/bin/sh
2# Login daemon for PCDM
3# This 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 -loop"
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# Now start the X Server
39while [ ! -e /var/run/nologin ]; do
40  /usr/local/bin/pc-checkxdisplay
41  # Make sure the authorization file does not exist
42  if [ -f ${PCDMAUTHFILE} ]; then
43    rm ${PCDMAUTHFILE}
44  fi
45  setenv XAUTHORITY ${PCDMAUTHFILE} #Set the auth file location
46  touch ${PCDMAUTHFILE} #Create the (empty) authorization file
47  xauth -f ${PCDMAUTHFILE} add :0 MIT-MAGIC-COOKIE-1 `openssl rand -hex 64` #Add a
48default entry to the file (randomized)
49  if [ -n "$vnccmd" ] ; then
50    # Start VNC
51    (sleep 10 ; $vnccmd >/var/log/vncserver 2>/var/log/vncserver) &
52  fi
53  xinit /usr/local/bin/PCDM-session -once -- :0 -auth ${PCDMAUTHFILE} $XOPTS
54done
Note: See TracBrowser for help on using the repository browser.