Initial import of the CDE 2.1.30 sources from the Open Group.

This commit is contained in:
Peter Howkins
2012-03-10 18:21:40 +00:00
commit 83b6996daa
18978 changed files with 3945623 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
XCOMM $XConsortium: Imakefile /main/4 1995/12/04 10:54:28 rswiston $
/* *
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
* (c) Copyright 1993, 1994 International Business Machines Corp. *
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
* (c) Copyright 1993, 1994 Novell, Inc. *
*/
#define IHaveSubdirs
#define PassCDebugFlags 'CDEBUGFLAGS=$(CDEBUGFLAGS)'
SUBDIRS = ibm sun hp dec
MakeSubdirs($(SUBDIRS))
DependSubdirs($(SUBDIRS))

View File

@@ -0,0 +1,14 @@
XCOMM $XConsortium: Imakefile /main/2 1996/04/21 19:54:47 drk $
/* *
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
* (c) Copyright 1993, 1994 International Business Machines Corp. *
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
* (c) Copyright 1993, 1994 Novell, Inc. *
*/
LOCAL_CPP_DEFINES = -DCDE_INSTALLATION_TOP=$(CDE_INSTALLATION_TOP) \
-DCDE_CONFIGURATION_TOP=$(CDE_CONFIGURATION_TOP)
AllTarget(xlogin)
CppScriptTarget(xlogin,xlogin.src,$(LOCAL_CPP_DEFINES),)

View File

@@ -0,0 +1,165 @@
XCOMM!/sbin/sh
XCOMM $XConsortium: xlogin.src /main/3 1996/04/23 12:11:45 drk $
XCOMM *****************************************************************
XCOMM * *
XCOMM * Copyright (c) Digital Equipment Corporation, 1991, 1995 *
XCOMM * *
XCOMM * All Rights Reserved. Unpublished rights reserved under *
XCOMM * the copyright laws of the United States. *
XCOMM * *
XCOMM * The software contained on this media is proprietary to *
XCOMM * and embodies the confidential technology of Digital *
XCOMM * Equipment Corporation. Possession, use, duplication or *
XCOMM * dissemination of the software and media is authorized only *
XCOMM * pursuant to a valid written license from Digital Equipment *
XCOMM * Corporation. *
XCOMM * *
XCOMM * RESTRICTED RIGHTS LEGEND Use, duplication, or disclosure *
XCOMM * by the U.S. Government is subject to restrictions as set *
XCOMM * forth in Subparagraph (c)(1)(ii) of DFARS 252.227-7013, *
XCOMM * or in FAR 52.227-19, as applicable. *
XCOMM * *
XCOMM *****************************************************************
#define HASH #
StartDisplayManager() {
$X_DISPLAY_MANAGER -daemon $CONFIG_OPTION
XCOMM
XCOMM If X is started from a console login, kill the console login, but only if
XCOMM there is a local graphics display and the graphics console (not serial
XCOMM console) is in use.
XCOMM
if [ x$HASDISPLAYS != x0 -a x$GENERIC_CONS = x0 ]; then
CONS=`tty`
PPID=`ps -fp $$ | grep -v PID | awk '{print $3}'`
if [ "$PPID" != "1" -a "$CONS" = "/dev/console" ]; then
kill -kill $PPID
fi
fi
}
StopDisplayManager() {
PIDFILE=`grep pid $CONFIGFILE | cut -d':' -f2`
if [ -r $PIDFILE ] && ( ps `cat $PIDFILE` > /dev/null ); then
kill `cat $PIDFILE`
else
HASH kill it anyway
PIDLIST=`ps ax | egrep '/usr/bin/X11/xdm|/bin/dtlogin' | egrep -v 'grep' | awk
'{print $1}'`
if [ -n "$PIDLIST" ]; then
kill $PIDLIST
else
PIDLIST=`ps ax | egrep 'dtlogin|xdm' | egrep -v 'grep|sbin' | awk '{print $1}'`
if [ -n "$PIDLIST" ]; then
kill $PIDLIST
else
echo "$0 WARNING: X login manager does not appear to be running."
fi
fi
fi
}
XCOMM
XCOMM Script execution starts here.
XCOMM
PATH=/sbin:/usr/sbin:/usr/bin
export PATH
DTLOGIN=CDE_INSTALLATION_TOP/bin/dtlogin
DTCONFIGFILE=CDE_INSTALLATION_TOP/config/Xconfig
DTSERVERSFILE=CDE_INSTALLATION_TOP/config/Xservers
XCOMM
XCOMM Read configuration for login manager choice
XCOMM
XCOMM default login manager is CDE's dtlogin
TMP=`rcmgr get XLOGIN`
if [ "$TMP" = "" ]; then
echo "$0 WARNING: rc.config does not specify XLOGIN, defaulting to cde."
XLOGIN=cde
else
XLOGIN=$TMP
fi
XCOMM
XCOMM Pick default values for X_DISPLAY_MANAGER and CONFIGFILE
XCOMM
HASDISPLAYS=`/usr/sbin/sizer -wu`
GENERIC_CONS=`/usr/sbin/sizer -wc`
if [ $XLOGIN = cde ]; then
X_DISPLAY_MANAGER=$DTLOGIN
HASH
HASH Do use the config option.
HASH
CONFIGFILE=$DTCONFIGFILE
CONFIG_OPTION="-config $DTCONFIGFILE"
if [ x$HASDISPLAYS = x0 -o x$GENERIC_CONS = x2 ]; then
EXT=nc
else
EXT=con
fi
if [ -e $DTCONFIGFILE.$EXT ]; then
ln -s -f $DTCONFIGFILE.$EXT $DTCONFIGFILE
else
echo "$0 WARNING: $DTCONFIGFILE.$EXT not found."
fi
if [ -e $DTSERVERSFILE.$EXT ]; then
ln -s -f $DTSERVERSFILE.$EXT $DTSERVERSFILE
else
echo "$0 WARNING: $DTSERVERSFILE.$EXT not found."
fi
elif [ $XLOGIN = xdm ]; then
X_DISPLAY_MANAGER=/usr/bin/X11/xdm
HASH
HASH Only specify a config file for xdm.
HASH
if [ x$HASDISPLAYS = x0 -o x$GENERIC_CONS = x2 ]; then
CONFIGFILE=/usr/var/X11/xdm/xdm-config.fs
else
CONFIGFILE=/usr/var/X11/xdm/xdm-config
fi
if [ -s $CONFIGFILE ]; then
CONFIG_OPTION="-config $CONFIGFILE"
else
CONFIG_OPTION=""
echo "$0 WARNING: $XLOGIN Display manager config file $CONFIGFILE not readable."
fi
else
echo "$0 ERROR: $XLOGIN is not supported. Please check /etc/rc.config file"
exit
fi
XCOMM If the login manager is not installed, complain and exit.
XCOMM
if [ ! -x $X_DISPLAY_MANAGER ]; then
echo "$0 ERROR: $X_DISPLAY_MANAGER not executable"
exit
fi
XCOMM
XCOMM Control X Display Manager
XCOMM
case $1 in
'restart')
StopDisplayManager
sleep 8
StartDisplayManager
;;
'start')
StartDisplayManager
;;
'stop')
StopDisplayManager
;;
esac

View File

@@ -0,0 +1,113 @@
$ $XConsortium: dtconfig.msg /main/3 1995/11/03 11:28:06 rswiston $
$ * *
$ * (c) Copyright 1993, 1994 Hewlett-Packard Company *
$ * (c) Copyright 1993, 1994 International Business Machines Corp. *
$ * (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
$ * (c) Copyright 1993, 1994 Novell, Inc. *
$ *
$ *****************************************************************************
$ **
$ ** File: dtconfig.msg
$ **
$ ** Project: CDE Session Management (dtconfig)
$ **
$ ** Description:
$ ** -----------
$ ** This file is the source for the message catalog for dtconfig
$ **
$ ** Message set 10: IBM
$ ** Message set 20: Sun
$ **
$ *****************************************************************************
$ *****************************************************************************
$ ** Message set 10: For IBM platforms
$ *****************************************************************************
$set 10
1 can only be run by the super user. \n
$
2 The CDE environment is now set as the default user interface. This\n\
interface will appear on login for all users of the system.\n\
To see this change take effect you must shutdown and restart your system.\n
$
3 The Command line is now set as the default user interface. This\n\
interface will appear on login for all users of the system.\n\
To see this change take effect you must shutdown and restart your system.\n
4 The CDE environment is Already set as the default User Interface.\n
$
5 The Command line is already set as the default User Interface.\n
$
6 usage: %s\n\
-e (enable auto-start of dtlogin)\n\
-d (disable auto-start of dtlogin)\n\
-kill (kill dtlogin)\n\
-reset (reset dtlogin - reread configuration files)\n
$
7 Too many arguments \n
$
8 Needs one argument \n
$
9 Could not disable xdm, Please refer to xdm man pages to disable\n\
xdm and try again. \n
$
10 Dtlogin is not running \n
$ *****************************************************************************
$ ** Message set 20: For Sun Platforms
$ *****************************************************************************
$set 20
$
1 CDE configuration utility
$
2 %s -d (disable auto-start)
3 %s -e (enable auto-start)
4 %s -kill (kill dtlogin)
5 %s -reset (reset dtlogin)
6 %s -p (printer action update)
$
$ In above messages 2 through 6, only translate words between
$ left "(" and right ").
$
7 %s: this script must be run as root
8 Usage: Too many arguments
9 Usage: Needs one argument
10 option failed
11 could not execute %s
12 disable failed
13 could not remove %s
14 done
15 desktop auto-start disabled.
16 enable failed
17 could not find %s
18 could not create %s
19 could not create %s
20 desktop auto-start enabled.
21 dtlogin kill complete.
22 dtlogin config resources reloaded.
23 printer action update is complete
24 Usage:
25 %s -inetd (inetd.conf /usr/dt daemons)
26 %s -inetd.ow (inetd.conf /usr/openwin daemons)
$
$ In above messages 25 and 26, only translate words between
$ left "(" and right ").
$
27 Next system boot, following will be run from /usr/dt/bin
$
28 rpc.ttdbserverd (ToolTalk)
29 rpc.cmsd (Calendar Manager)
30 dtspcd (Subprocess Control)
$
$ Keep column allignment on messages 28 thru 30.
$ Only translate what's beteen ( )'s
$
31 Next system boot, following will be run from /usr/openwin/bin
$
32 rpc.ttdbserverd (ToolTalk)
33 rpc.cmsd (Calendar Manager)
$
$ Keep column allignment on messages 32 thru 33.
$ Only translate what's beteen ( )'s
$

View File

@@ -0,0 +1,22 @@
XCOMM $XConsortium: Imakefile /main/5 1996/07/24 14:15:31 drk $
/* *
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
* (c) Copyright 1993, 1994 International Business Machines Corp. *
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
* (c) Copyright 1993, 1994 Novell, Inc. *
*/
LOCAL_CPP_DEFINES = -DCDE_INSTALLATION_TOP=$(CDE_INSTALLATION_TOP) \
-DCDE_CONFIGURATION_TOP=$(CDE_CONFIGURATION_TOP)
TARGETS = dtconfig dtlogin.rc \
dtrc dtrc.dtlogin_st dtrc.getty_wait dtrc.graph_conf
AllTarget($(TARGETS))
CppScriptTarget(dtconfig,dtconfig.src,$(LOCAL_CPP_DEFINES),)
CppScriptTarget(dtlogin.rc,dtlogin.rc.src,$(LOCAL_CPP_DEFINES),)
CppScriptTarget(dtrc,dtrc.src,$(LOCAL_CPP_DEFINES),)
CppScriptTarget(dtrc.dtlogin_st,dtrc.dtlogin_st.src,$(LOCAL_CPP_DEFINES),)
CppScriptTarget(dtrc.getty_wait,dtrc.getty_wait.src,$(LOCAL_CPP_DEFINES),)
CppScriptTarget(dtrc.graph_conf,dtrc.graph_conf.src,$(LOCAL_CPP_DEFINES),)

View File

@@ -0,0 +1,163 @@
XCOMM!/sbin/sh
XCOMM $XConsortium: dtconfig.src /main/1 1996/07/24 11:39:47 drk $
XCOMM
XCOMM This version of the CDE dtconfig script is for use in the HP-UX
XCOMM operating environment.
XCOMM
XCOMM Common Desktop Environment
XCOMM
XCOMM (c) Copyright 1996 Digital Equipment Corporation.
XCOMM (c) Copyright 1993-1994,1996 Hewlett-Packard Company.
XCOMM (c) Copyright 1993-1994,1996 International Business Machines Corp.
XCOMM (c) Copyright 1993-1994,1996 Sun Microsystems, Inc.
XCOMM (c) Copyright 1993-1994,1996 Novell, Inc.
XCOMM (c) Copyright 1996 FUJITSU LIMITED.
XCOMM (c) Copyright 1996 Hitachi.
XCOMM
XCOMM This script can be run after CDE installation to configure CDE within
XCOMM the host platforms operating environment. For example, when auto-start
XCOMM is selected, the CDE desktop login window will be displayed at end of the
XCOMM workstation's power up boot cycle.
XCOMM
XCOMM Location: CDE_INSTALLATION_TOP/bin/dtconfig
PATH=/sbin:/usr/sbin:/usr/bin:/usr/dt/bin
export PATH
mode=$1
arg_count=$#
prg_name=$0
Message()
{
XCOMM Message() - display message from dtconfig.cat
XCOMM $1 - message id
XCOMM $2 - fallback message text
if [ -x $DTDSPMSG ]; then
NLSPATH=/usr/dt/lib/nls/msg/%L/%N.cat:/usr/dt/lib/nls/msg/C/%N.cat $DTDSPMSG -s 30 dtconfig $1 "$2" "$3"
echo " "
else
echo "$2"
fi
}
usage_error() {
echo " "
Message 1 " CDE configuration utility"
echo " "
Message 2 " $prg_name -d (disable auto-start)" $prg_name
Message 3 " $prg_name -e (enable auto-start)" $prg_name
Message 4 " $prg_name -kill (kill dtlogin)" $prg_name
Message 5 " $prg_name -reset (reset dtlogin)" $prg_name
Message 6 " $prg_name -p (printer action update)" $prg_name
echo " "
}
DTDSPMSG=/usr/dt/bin/dtdspmsg
RC_MASTER=/sbin/init.d/dtlogin.rc
RC_CONFIG_DESKTOP=/etc/rc.config.d/desktop
VUERC=/usr/vue/bin/vuerc
set `id`
if [ $1 != "uid=0(root)" ]; then
Message 7 "$prg_name: this script must be run as root" $prg_name
exit 1
fi
if [ $arg_count -ne 1 ]; then
echo " "
XCOMM
XCOMM Display error message for too many arguments
XCOMM
if [ $arg_count -gt 1 ]; then
Message 8 "Usage: Too many arguments"
XCOMM
XCOMM Display error message for NULL arguments passed
XCOMM
elif [ $arg_count -eq 0 ]; then
Message 9 "Usage: Needs one argument"
fi
usage_error
exit 1
fi
rc_master_check() {
if [ ! -x $RC_MASTER ]; then
Message 10 "option failed"
Message 11 "could not execute $RC_MASTER" $RC_MASTER
exit 1
fi
}
case "$mode" in
'-d')
(
if [ -f $RC_CONFIG_DESKTOP ]; then
DESKTOP=""
. $RC_CONFIG_DESKTOP
if [ CDE = "$DESKTOP" ]; then
echo "# CDE Desktop disabled `date`" >$RC_CONFIG_DESKTOP
fi
fi
)
Message 14 "done"
Message 15 "desktop auto-start disabled."
;;
'-e')
#if (OSMAJORVERSION <= 10) && (OSMINORVERSION < 20)
if [ -f /tcb/files/auth/system/default ]; then
Message 25 "CDE can not be enabled on a trusted system"
Message 26 "unable to enable desktop auto-start"
exit 1
fi
#endif
echo "# CDE Desktop enabled `date`" >$RC_CONFIG_DESKTOP
echo "DESKTOP=CDE" >>$RC_CONFIG_DESKTOP
Message 14 "done"
Message 20 "desktop auto-start enabled."
;;
'-kill')
rc_master_check
$RC_MASTER stop
Message 14 "done"
Message 21 "dtlogin kill complete."
;;
'-reset')
rc_master_check
$RC_MASTER reset
Message 14 "done"
Message 22 "dtlogin config resources reloaded."
;;
'-p')
rc_master_check
$RC_MASTER update_printers
Message 14 "done"
Message 23 "printer action update is complete"
;;
*)
echo " "
Message 24 "Usage:"
usage_error
exit 1
;;
esac
exit 0

View File

@@ -0,0 +1,153 @@
XCOMM!/sbin/sh
XCOMM $XConsortium: dtlogin.rc.src /main/1 1996/07/24 11:40:29 drk $
XCOMM
XCOMM This version of the dtlogin.rc script can be used on the HP-UX
XCOMM operating system to initiate 1DE tasks such as starting the dtlogin
XCOMM process.
XCOMM
XCOMM Common Desktop Environment
XCOMM
XCOMM (c) Copyright 1996 Digital Equipment Corporation.
XCOMM (c) Copyright 1993-1994,1996 Hewlett-Packard Company.
XCOMM (c) Copyright 1993-1994,1996 International Business Machines Corp.
XCOMM (c) Copyright 1993-1994,1996 Sun Microsystems, Inc.
XCOMM (c) Copyright 1993-1994,1996 Novell, Inc.
XCOMM (c) Copyright 1996 FUJITSU LIMITED.
XCOMM (c) Copyright 1996 Hitachi.
XCOMM
XCOMM When placed in the /sbin/rc3.d directory and named appropriately, such as
XCOMM "S990dtlogin", this script will automatically start the dtlogin window
XCOMM after the HP-UX system boots to its multi-user level.
XCOMM
XCOMM This script is also called indirectly by the CDE dtconfig command.
PATH=/sbin:/usr/sbin:/usr/bin:/usr/dt/bin
export PATH
mode=$1
case "$mode" in
'start_msg')
echo "Start CDE login server"
exit 0
;;
'stop_msg')
echo "Stop CDE login server"
exit 0
;;
esac
usage_error() {
echo " $0 start (start dtlogin process)"
echo " $0 stop (stop dtlogin process)"
echo " $0 reset (reset dtlogin process)"
echo " $0 update_printers (update print actions)"
echo " "
}
if [ ! -d /usr/bin ]; then # /usr not mounted
exit 1
fi
set `id`
if [ $1 != "uid=0(root)" ]; then
echo "$0: must be run as root"
exit 1
fi
XCOMM update_printers()
XCOMM
XCOMM Add print actions to workstation's database for all printers known
XCOMM to this workstation if action is not already present in the database.
update_printers() {
if [ -x /usr/dt/bin/dtprintinfo ]; then
/usr/dt/bin/dtprintinfo -populate
fi
}
XCOMM
XCOMM Find login server pid from the process tree
XCOMM
login_server_pid() {
XCOMM In following grep for "dtlogin" processes, explictly exclude any matches
XCOMM on this shell file named "dtlogin.rc"
#if (OSMAJORVERSION < 10) && (OSMINORVERSION < 20)
ps -u 0 -l | grep -v dtlogin. | grep dtlogin |
cut -c1-24 | awk '{print $4 " " $5}' |
while read pid ppid; do
#else
XCOMM
XCOMM Use the new XPG4 features of "ps" (also "-C cmdlist" ) to get the pids.
XCOMM
UNIX95=1 ps -C dtlogin -o pid= -o ppid= |
while read pid ppid; do
#endif
if [ "$(ps -p $ppid | grep dtlogin)" = "" ]; then
print "$pid"
break
fi
done
}
case "$mode" in
'start')
if [ -f /etc/rc.config ]; then
. /etc/rc.config
else
echo "ERROR: /etc/rc.config defaults file MISSING"
fi
if [ "CDE" != "${DESKTOP:-}" ]; then
exit 2
fi
update_printers
if [ -x CDE_INSTALLATION_TOP/bin/dtrc ]; then
trap "" 1
CDE_INSTALLATION_TOP/bin/dtrc &
elif [ -x CDE_INSTALLATION_TOP/bin/dtlogin ]; then
CDE_INSTALLATION_TOP/bin/dtlogin -daemon
fi
;;
'stop')
XCOMM get dtlogin pid
dtlogin_pid=`login_server_pid`
XCOMM kill dtlogin process
if [ "$dtlogin_pid" != "" ] ; then
kill $dtlogin_pid
fi
;;
'reset')
XCOMM get dtlogin pid
dtlogin_pid=`login_server_pid`
XCOMM reset dtlogin process
if [ "$dtlogin_pid" != "" ] ; then
kill -HUP $dtlogin_pid
fi
;;
'update_printers')
update_printers
;;
*)
usage_error
exit 1
;;
esac
exit 0

View File

@@ -0,0 +1,72 @@
XCOMM!/sbin/sh
XCOMM $XConsortium: dtrc.dtlogin_st.src /main/1 1996/07/24 11:41:05 drk $
XCOMM
XCOMM This version of the CDE dtconfig script is for use in the HP-UX
XCOMM operating environment.
XCOMM
XCOMM Common Desktop Environment
XCOMM
XCOMM (c) Copyright 1996 Digital Equipment Corporation.
XCOMM (c) Copyright 1993-1994,1996 Hewlett-Packard Company.
XCOMM (c) Copyright 1993-1994,1996 International Business Machines Corp.
XCOMM (c) Copyright 1993-1994,1996 Sun Microsystems, Inc.
XCOMM (c) Copyright 1993-1994,1996 Novell, Inc.
XCOMM (c) Copyright 1996 FUJITSU LIMITED.
XCOMM (c) Copyright 1996 Hitachi.
XCOMM
XCOMM This script runs dtlogin.
XCOMM
XCOMM Location: CDE_INSTALLATION_TOP/config/dtrc.d/90_dtlogin_st
PATH=/sbin:/usr/sbin:/usr/bin:/usr/dt/bin
export PATH
XCOMM Default version
DTLOGIN=CDE_INSTALLATION_TOP/bin/dtlogin
VL_ARGS=""
if [ -x "$DTLOGIN" ]; then
exec $DTLOGIN $VL_ARGS </dev/null >/dev/null 2>&1
else
XCOMM
XCOMM Note: This path occurs if dtlogin can not be found or
XCOMM is not executable...
XCOMM
XCOMM
XCOMM Wait for the console getty (if any) to start.
XCOMM
for COUNT in 1 2 3 4 5
do
TMP=`ps -tconsole | fgrep getty`
if [ $? -eq 0 ]; then
GETTY=true
break
fi
sleep 1
done
XCOMM
XCOMM Print a message to the console.
XCOMM
echo "" > /dev/console
DTRC=CDE_INSTALLATION_TOP/bin/dtrc
echo "The desktop can not be started. (See $DTRC)" > /dev/console
XCOMM
XCOMM If a getty is not already running on the console, start one.
XCOMM
if [ -z "$GETTY" ]; then
exec /etc/getty console console
fi
fi
XCOMM ################## eof #####################

View File

@@ -0,0 +1,40 @@
XCOMM!/sbin/sh
XCOMM $XConsortium: dtrc.getty_wait.src /main/1 1996/07/24 11:41:57 drk $
XCOMM
XCOMM This version of the CDE dtconfig script is for use in the HP-UX
XCOMM operating environment.
XCOMM
XCOMM Common Desktop Environment
XCOMM
XCOMM (c) Copyright 1996 Digital Equipment Corporation.
XCOMM (c) Copyright 1993-1994,1996 Hewlett-Packard Company.
XCOMM (c) Copyright 1993-1994,1996 International Business Machines Corp.
XCOMM (c) Copyright 1993-1994,1996 Sun Microsystems, Inc.
XCOMM (c) Copyright 1993-1994,1996 Novell, Inc.
XCOMM (c) Copyright 1996 FUJITSU LIMITED.
XCOMM (c) Copyright 1996 Hitachi.
XCOMM
XCOMM This script waits for the console getty to start. This prevents dtlogin
XCOMM from running an X server that would grab the display before the rc
XCOMM checklist is complete.
XCOMM
XCOMM Location: CDE_INSTALLATION_TOP/config/dtrc.d/10_getty_wait
XCOMM
XCOMM Wait for the console getty to start.
XCOMM
PATH=/sbin:/usr/sbin:/usr/bin:/usr/dt/bin
export PATH
let count=0
while [ $count -lt 60 ]
do
TMP=`ps -tconsole | fgrep getty`
if [ $? -eq 0 ]; then
GETTY=true
break
fi
sleep 2
let count=count+1
done

View File

@@ -0,0 +1,51 @@
XCOMM!/sbin/sh
XCOMM $XConsortium: dtrc.graph_conf.src /main/1 1996/07/24 11:42:43 drk $
XCOMM
XCOMM This version of the CDE dtconfig script is for use in the HP-UX
XCOMM operating environment.
XCOMM
XCOMM Common Desktop Environment
XCOMM
XCOMM (c) Copyright 1996 Digital Equipment Corporation.
XCOMM (c) Copyright 1993-1994,1996 Hewlett-Packard Company.
XCOMM (c) Copyright 1993-1994,1996 International Business Machines Corp.
XCOMM (c) Copyright 1993-1994,1996 Sun Microsystems, Inc.
XCOMM (c) Copyright 1993-1994,1996 Novell, Inc.
XCOMM (c) Copyright 1996 FUJITSU LIMITED.
XCOMM (c) Copyright 1996 Hitachi.
XCOMM
XCOMM This script:
XCOMM - copies CDE_INSTALLATION_TOP/config/Xservers to
XCOMM CDE_CONFIGURATION_TOP/config if it does not yet exist,
XCOMM - uses ioscan to find out if the system has a graphics card
XCOMM installed,
XCOMM - comments out the "Local" entry in the Xservers file if it
XCOMM does not,
XCOMM
XCOMM Location: CDE_INSTALLATION_TOP/config/dtrc.d/20_graph_conf
PATH=/sbin:/usr/sbin:/usr/bin:/usr/dt/bin
export PATH
XCOMM
XCOMM create CDE_CONFIGURATION_TOP/config/Xservers if it does not exist
if [ ! -f CDE_CONFIGURATION_TOP/config/Xservers ]; then
cp CDE_INSTALLATION_TOP/config/Xservers \
CDE_CONFIGURATION_TOP/config/Xservers
fi
XCOMM
XCOMM comment out the Local entry if there is no graphics card
if [[ -z `ioscan -kC graphics` ]]; then
TAB=" "
TS="[${TAB} ]"
sed -e "s:^${TS}*\*${TS}${TS}*Local:# * Local:" \
< CDE_CONFIGURATION_TOP/config/Xservers \
> /tmp/Xservers.tmp
cp /tmp/Xservers.tmp CDE_CONFIGURATION_TOP/config/Xservers
rm -f /tmp/Xservers.tmp
fi
XCOMM ################## eof #####################

View File

@@ -0,0 +1,97 @@
XCOMM!/sbin/sh
XCOMM $XConsortium: dtrc.src /main/6 1996/07/24 14:15:50 drk $
XCOMM ################################################################
XCOMM
XCOMM dtrc
XCOMM
XCOMM Common Desktop Environment
XCOMM
XCOMM Shell script for initialization of the Common Desktop Environment
XCOMM
XCOMM (c) Copyright 1996 Digital Equipment Corporation.
XCOMM (c) Copyright 1993-1994,1996 Hewlett-Packard Company.
XCOMM (c) Copyright 1993-1994,1996 International Business Machines Corp.
XCOMM (c) Copyright 1993-1994,1996 Sun Microsystems, Inc.
XCOMM (c) Copyright 1993-1994,1996 Novell, Inc.
XCOMM (c) Copyright 1996 FUJITSU LIMITED.
XCOMM (c) Copyright 1996 Hitachi.
XCOMM
XCOMM ************** DO NOT EDIT THIS FILE **************
XCOMM
XCOMM CDE_INSTALLATION_TOP/bin/dtrc is a factory-default file and will
XCOMM be unconditionally overwritten upon subsequent installation.
XCOMM Modification is discouraged.
XCOMM
XCOMM ################################################################
#define HASH #
PATH=/sbin:/usr/sbin:/usr/bin:/usr/dt/bin
export PATH
DTRC_D=CDE_INSTALLATION_TOP/config/dtrc.d
DTLOGIN=CDE_INSTALLATION_TOP/bin/dtlogin
VL_ARGS=""
if [ -d $DTRC_D ]
then
HASH
HASH run the scripts in CDE_INSTALLATION_TOP/config/dtrc.d
HASH in lexical (ls) order
HASH
ls $DTRC_D/[0-9][0-9]_* |
while read DTRCFILE
do
$DTRCFILE
done
else
HASH
HASH dtrc.d directory does not exist
HASH
if [ -x "$DTLOGIN" ]
then
exec $DTLOGIN $VL_ARGS </dev/null >/dev/null 2>&1
else
HASH
HASH Note: This path occurs if dtlogin can not be found or
HASH is not executable...
HASH
HASH
HASH Wait for the console getty (if any) to start.
HASH
for COUNT in 1 2 3 4 5
do
TMP=`ps -tconsole | fgrep getty`
if [ $? -eq 0 ]; then
GETTY=true
break
fi
sleep 1
done
HASH
HASH Print a message to the console.
HASH
echo "" > /dev/console
DTRC=CDE_INSTALLATION_TOP/bin/dtrc
echo "The desktop can not be started. (See $DTRC)" > /dev/console
HASH
HASH Start getty on the console if it isn't running already.
HASH
if [ -z "$GETTY" ]; then
exec /etc/getty console console
fi
fi
fi
XCOMM ################## eof #####################

View File

@@ -0,0 +1,15 @@
XCOMM $XConsortium: Imakefile /main/4 1996/04/21 19:28:22 drk $
/* *
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
* (c) Copyright 1993, 1994 International Business Machines Corp. *
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
* (c) Copyright 1993, 1994 Novell, Inc. *
*/
LOCAL_CPP_DEFINES = -DCDE_INSTALLATION_TOP=$(CDE_INSTALLATION_TOP) \
-DCDE_CONFIGURATION_TOP=$(CDE_CONFIGURATION_TOP)
AllTarget(dtconfig rc.dt)
CppScriptTarget(dtconfig,dtconfig.src,$(LOCAL_CPP_DEFINES),)
CppScriptTarget(rc.dt,rc.dt.src,$(LOCAL_CPP_DEFINES),)

View File

@@ -0,0 +1,265 @@
XCOMM!/bin/ksh
XCOMM $XConsortium: dtconfig.src /main/5 1996/04/23 12:05:26 drk $
XCOMM * *
XCOMM * (c) Copyright 1993, 1994 Hewlett-Packard Company *
XCOMM * (c) Copyright 1993, 1994 International Business Machines Corp. *
XCOMM * (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
XCOMM * (c) Copyright 1993, 1994 Novell, Inc. *
XCOMM *
#define HASH #
DTPATH=CDE_INSTALLATION_TOP/bin/dtlogin
XDMCONF=/usr/lpp/X11/lib/X11/xdm/xdmconf
#ifdef _POWER
GETTY=/usr/sbin/getty
#else
GETTY=/etc/getty
#endif
#ifdef _POWER
#define MKITAB /usr/sbin/mkitab
#define RMITAB /usr/sbin/rmitab
#define LSITAB /usr/sbin/lsitab
#define RCDT "dt:`cat /etc/.init.state`:wait:/etc/rc.dt"
#define RCDT2 "dt:2:wait:/etc/rc.dt"
#else
#define MKITAB /etc/mkitab
#define RMITAB /etc/rmitab
#define LSITAB /etc/lsitab
#define RCDT "dt:`cat /etc/.init.state`:wait:/usr/dt/bin/rc.dt"
#define RCDT2 "dt:2:wait:/usr/dt/bin/rc.dt"
#endif
XCOMM
XCOMM Message text
XCOMM
msg1='can only be run by the super user. \n'
msg2='The CDE environment is now set as the default user interface. This \
interface will appear on login for all users of the system. \
To see this change take effect you must shutdown and restart your system.\n'
msg3='The Command line is now set as the default user interface. This\
interface will appear on login for all users of the system.\
To see this change take effect you must shutdown and restart your system.\n'
msg4='The CDE environment is Already set as the default User Interface.\n'
msg5='The Command line is already set as the default User Interface.\n'
msg6='usage: %s \
-e (enable auto-start of dtlogin) \
-d (disable auto-start of dtlogin) \
-kill (kill dtlogin) \
-reset (reset dtlogin - reread configuration files)\n'
msg7='Too many arguments \n'
msg8='Needs one argument \n'
msg9='Could not disable xdm, Please refer to xdm man pages to\
disable xdm and try again.\n'
msg10='Dtlogin is not running \n'
GetLoginServerPid()
{
HASH GetLoginServerPid() prints login server pid if found, else nothing
grep=/usr/bin/grep
ps=/usr/bin/ps
cut=/usr/bin/cut
awk=/usr/bin/awk
$ps -u 0 -el | $grep dtlogin | $awk '{print $4 " " $5}' |
while read -r pid ppid; do
if [ "$($ps -p $ppid | $grep dtlogin)" = "" ]; then
print "$pid"
break
fi
done
}
SignalDt()
{
HASH SignalDt() - kill or reset login server
HASH $1 - operation (kill|reset)
pid=`GetLoginServerPid`
if [ "$pid" != "" ]; then
if [ "$1" = "kill" ]; then
/bin/kill $pid #kill login server
else
/bin/kill -HUP $pid #reset login server
fi
Exit 0
else
Exit 1 200 "no login server is running\n"
fi
}
Message()
{
HASH Message() - display message from dtconfig.cat
HASH $1 - message id
HASH $2 - fallback message text
HASH $3 - message insert 1
HASH $4 - message insert 2
dspmsg -s 10 dtconfig.cat $1 "$2" "$3" "$4"
}
Exit()
{
HASH Exit() - display optional message and exit
HASH $1 - exit code
HASH $2 - message id (optional)
HASH $3 - fallback message text
HASH $4 - message insert 1
HASH $5 - message insert 2
if [ "$2" != "" ]; then
Message $2 "$3" "$4" "$5"
fi
exit $1
}
DisableXdm()
{
HASH DisableXdm() - disable inittab start of xdm if necessary
HASH
HASH Check for xdm inittab entry
HASH
egrep "^xdm" /etc/inittab > /dev/null 2>&1
rc=$?
HASH
HASH Check for the existence of xdm Subsystem.
HASH
lssrc -s xdm > /dev/null 2>&1
rc1=$?
HASH
HASH if either or both of the tests are true unconfigure xdm
HASH Note that a return code of 0 is true
HASH
if [ "$rc" = "0" ] || [ "$rc1" = "0" ]; then
if [ ! -f $XDMCONF ]; then
Exit 1 9 "$msg9"
fi
$XDMCONF -d
fi
}
ConfigureDt()
{
HASH ConfigureDt() - enable or disable inittab start of dtlogin
HASH $1 - operation (enable|disable)
HASH
HASH Disable xdm if necessary
HASH
DisableXdm
HASH
HASH Check for the existence of COSE Subsystem and create if
HASH it's not there are we are enabling dtlogin
HASH
/bin/lssrc -s dtsrc > /dev/null 2>&1
if [ "$?" -ne 0 -a "$1" = "enable" ]; then
/bin/mkssys -s dtsrc -p $DTPATH -u 0 > /dev/null 2>&1
fi
HASH
HASH See if 'dt' is in inittab
HASH
LSITAB dt > /dev/null 2>&1
if [ "$?" -ne 0 ]; then
curstate="disabled"
else
curstate="enabled"
fi
if [ "$1" = "enable" ]; then
if [ "$curstate" = "enabled" ]; then
HASH
HASH Already enabled
HASH
Exit 0 4 "$msg4"
fi
HASH
HASH Enable it
HASH
if [ -s /etc/.init.state ]; then
MKITAB RCDT
else
HASH
HASH if /etc/.init.state does NOT exist, hard code a 2 in the inittab entry
HASH
MKITAB RCDT2
fi
Message 2 "$msg2"
HASH
HASH move the "cons" record to the end of inittab file,
HASH and, after the "dt" record to let desktop come up
HASH before console login.
HASH
consitab=`LSITAB cons`
if [ ! -z "$consitab" ]; then
RMITAB cons
MKITAB -i dt "$consitab"
fi
Exit 0
else # $1 = "disable"
if [ "$curstate" = "disabled" ]; then
HASH
HASH Already disabled
HASH
Exit 0 5 "$msg5"
fi
HASH
HASH remove the "dt" inittab entry for disabling "dt"
HASH Note: The "dtsrc" subsystem would remain intact.
HASH It gets removed only when the super user deletes it
HASH explicitly by the rmssys command.
HASH
RMITAB "dt"
Message 3 "$msg3"
Exit 0
fi
}
XCOMM
XCOMM Check if the user is a super user.
XCOMM
if [ "root" != `/usr/bin/whoami` ]; then
echo "`basename $0`: \c"
Exit 1 1 "$msg1"
fi
XCOMM
XCOMM Check param count
XCOMM
if [ $# -ne 1 ]; then
Exit 1 6 "$msg6" "`basename $0` -e|-d|-kill|-reset"
fi
XCOMM
XCOMM Check options and run command
XCOMM
case $1 in
-e) ConfigureDt enable;;
-d) ConfigureDt disable;;
-kill) SignalDt kill;;
-reset) SignalDt reset;;
*) Exit 1 6 "$msg6" "`basename $0` -e|-d|-kill|-reset"
esac

View File

@@ -0,0 +1,94 @@
XCOMM! /bin/ksh
XCOMM $XConsortium: rc.dt.src /main/5 1996/04/23 12:05:38 drk $
XCOMM * *
XCOMM * (c) Copyright 1996 Digital Equipment Corporation.
XCOMM * (c) Copyright 1993,1994,1996 Hewlett-Packard Company.
XCOMM * (c) Copyright 1993,1994,1996 International Business Machines Corp.
XCOMM * (c) Copyright 1993,1994,1996 Sun Microsystems, Inc.
XCOMM * (c) Copyright 1993,1994,1996 Novell, Inc.
XCOMM * (c) Copyright 1996 FUJITSU LIMITED.
XCOMM * (c) Copyright 1996 Hitachi.
#define HASH #
XCOMM COMPONENT_NAME: DESKTOP rc.dt
XCOMM
XCOMM FUNCTIONS:
XCOMM
XCOMM ORIGINS: 27
XCOMM
XCOMM (C) COPYRIGHT International Business Machines Corp. 1994, 1995
XCOMM All Rights Reserved
XCOMM Licensed Materials - Property of IBM
XCOMM
XCOMM US Government Users Restricted Rights - Use, duplication or
XCOMM disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
XCOMM
XCOMM ###################################################################
XCOMM rc.dt -
XCOMM starts the AIX Windows Desktop Login
XCOMM waits for the X Server to start
XCOMM ###################################################################
if [ "$1" != "boot" -a -f /.bootsequence ]
then
XCOMM
XCOMM clean things up from graphical boot
XCOMM
/usr/bin/rm -f /.bootsequence
if [ -f /.bootsequence ]; then
echo "\n\nError: Unable to remove /.bootsequence.\n\n"
fi
/usr/bin/ps -ef | /usr/bin/grep "dtlogin" | /usr/bin/grep -v grep >/dev/null
if [ "$?" -eq 0 ] ; then
exit 0
fi
fi
XCOMM
XCOMM Start the dtsrc subsystem
XCOMM
if [ "$1" = "boot" ]; then
/usr/dt/bin/dtlogin -daemon
else
/usr/bin/startsrc -s dtsrc 2>/dev/null 1>/dev/null
fi
XCOMM
XCOMM Check for error on starting the dtsrc subsystem
XCOMM
rc=$?
if [ "$rc" != "0" ]; then
echo "\n\nERROR: The AIX Windows Desktop is not correctly configured\n"
exit 1
fi
echo "Starting AIX Windows Desktop....\c"
XCOMM
XCOMM Sleep for <= 10 secs for the X server to come up.
XCOMM
i=10
while [ "$i" != 0 ]
do
HASH
HASH checking if the X server is up and running.
HASH
XPID=`ps -ef | awk '$8~/^.*\/X$/{print $3}'`
if [ -n "$XPID" ]; then
ps -ef | grep $XPID | grep "dtlogin" | grep -v grep 1>/dev/null
rc=$?
else
rc=1
fi
if [ "$rc" -eq "0" ]; then
break
fi
sleep 1
echo ".\c"
i=`expr $i - 1` # decrement count
done
sleep 1

View File

@@ -0,0 +1,15 @@
XCOMM $XConsortium: Imakefile /main/4 1996/04/21 19:28:31 drk $
/* *
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
* (c) Copyright 1993, 1994 International Business Machines Corp. *
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
* (c) Copyright 1993, 1994 Novell, Inc. *
*/
LOCAL_CPP_DEFINES = -DCDE_INSTALLATION_TOP=$(CDE_INSTALLATION_TOP) \
-DCDE_CONFIGURATION_TOP=$(CDE_CONFIGURATION_TOP)
AllTarget(dtconfig dtlogin.rc)
CppScriptTarget(dtconfig,dtconfig.src,$(LOCAL_CPP_DEFINES),)
CppScriptTarget(dtlogin.rc,dtlogin.rc.src,$(LOCAL_CPP_DEFINES),)

View File

@@ -0,0 +1,513 @@
XCOMM!/bin/ksh
XCOMM $XConsortium: dtconfig.src /main/5 1996/04/23 12:12:10 drk $
XCOMM (c) Copyright 1996 Digital Equipment Corporation.
XCOMM (c) Copyright 1993,1994,1996 Hewlett-Packard Company.
XCOMM (c) Copyright 1993,1994,1996 International Business Machines Corp.
XCOMM (c) Copyright 1993,1994,1996 Sun Microsystems, Inc.
XCOMM (c) Copyright 1993,1994,1996 Novell, Inc.
XCOMM (c) Copyright 1996 FUJITSU LIMITED.
XCOMM (c) Copyright 1996 Hitachi.
XCOMM (c) Copyright 1993, 1994 Unix System Labs, Inc., a subsidiary of
XCOMM Novell, Inc.
XCOMM
XCOMM This version of the CDE dtconfig script is for use in the Solaris(TM)
XCOMM operating environment.
XCOMM
XCOMM Common Desktop Environment
XCOMM
XCOMM This script can be run after CDE installation to configure CDE within
XCOMM the host platforms operating environment. For example, when auto-start
XCOMM is selected, the CDE desktop login window will be displayed at end of the
XCOMM workstation's power up boot cycle.
XCOMM
XCOMM Location: CDE_INSTALLATION_TOP/bin/dtconfig
#define HASH #
mode=$1
arg_count=$#
prg_name=$0
Message()
{
HASH Message() - display message from dtconfig.cat
HASH $1 - message id
HASH $2 - fallback message text
if [ -x $DTDSPMSG ]; then
$DTDSPMSG -s 20 dtconfig $1 "$2" "$3"
echo " "
else
echo "$2"
fi
}
usage_error() {
echo " "
Message 1 " CDE configuration utility"
echo " "
Message 2 " $prg_name -d (disable auto-start)" $prg_name
Message 3 " $prg_name -e (enable auto-start)" $prg_name
Message 4 " $prg_name -kill (kill dtlogin)" $prg_name
Message 5 " $prg_name -reset (reset dtlogin)" $prg_name
Message 6 " $prg_name -p (printer action update)" $prg_name
Message 25 " $prg_name -inetd (inetd.conf /usr/dt daemons)" $prg_name
Message 26 " $prg_name -inetd.ow (inetd.conf /usr/openwin daemons)" $prg_name
echo " "
}
XCOMM
XCOMM Allow for configured and factory versions of dtlogin.rc
XCOMM
if [ -f CDE_CONFIGURATION_TOP/config/dtlogin.rc ]
then
RC_MASTER=CDE_CONFIGURATION_TOP/config/dtlogin.rc
elif [ -f CDE_INSTALLATION_TOP/config/dtlogin.rc ]
then
RC_MASTER=CDE_INSTALLATION_TOP/config/dtlogin.rc
fi
RC_COPY=/etc/init.d/dtlogin
LEVEL_0_KILL=/etc/rc0.d/K10dtlogin
LEVEL_1_KILL=/etc/rc1.d/K10dtlogin
LEVEL_2_START=/etc/rc2.d/S99dtlogin
DTDSPMSG=/usr/dt/bin/dtdspmsg
NAWK=/usr/bin/nawk
set `/bin/id`
if [ $1 != "uid=0(root)" ]; then
Message 7 "$prg_name: this script must be run as root" $prg_name
exit 1
fi
if [ $arg_count -ne 1 ]; then
echo " "
HASH
HASH Display error message for too many arguments
HASH
if [ $arg_count -gt 1 ]; then
Message 8 "Usage: Too many arguments"
HASH
HASH Display error message for NULL arguments passed
HASH
elif [ $arg_count -eq 0 ]; then
Message 9 "Usage: Needs one argument"
fi
usage_error
exit 1
fi
rc_master_check() {
if [ ! -x $RC_MASTER ]; then
Message 10 "option failed"
Message 11 "could not execute $RC_MASTER" $RC_MASTER
exit 1
fi
}
nawk_check() {
if [ ! -x $NAWK ]; then
Message 10 "option failed"
Message 11 "could not execute $NAWK" $NAWK
exit 1
fi
}
XCOMM Following inetdSP() procedure is from Sun CDE SI post_install
XCOMM configMin file. It adds the Subprocess Control daemon inetd.conf
XCOMM line so it points to /usr/dt/bin/dtspcd.
inetdSP()
{
FILE=/etc/inetd.conf
TMPFILE=/tmp/inetd.conf
XCOMM
XCOMM check for existence of /etc/inetd.conf
XCOMM
if [ ! -f $FILE ] # highly unlikely
then
echo "" >$FILE
fi
XCOMM
XCOMM see if it already exists
XCOMM
$NAWK '{if ($1 == "dtspc")
print $0 > "/tmp/dtspc-already-there"
}' $FILE >/dev/null
DTSPCD=CDE_INSTALLATION_TOP/bin/dtspcd
if [ ! -f /tmp/dtspc-already-there ]
then
echo "dtspc stream tcp nowait root $DTSPCD $DTSPCD" >>$FILE
else
rm /tmp/dtspc-already-there
fi
XCOMM
XCOMM remove legacy entries like dtspcd
XCOMM
$NAWK '{if ($1 == "dtspcd" || $1 == "#dtspcd")
;
else
print $0
}' $FILE >$TMPFILE
cp $TMPFILE $FILE
rm $TMPFILE
FILE=/etc/services
TMPFILE=/tmp/services
XCOMM
XCOMM check for existence of /etc/services
XCOMM
if [ ! -f $FILE ] # highly unlikely
then
echo "" >$FILE
fi
XCOMM
XCOMM see if it already exists
XCOMM
$NAWK '{if ($1 == "dtspc")
print $0 > "/tmp/dtspc-already-there"
}' $FILE >/dev/null
if [ ! -f /tmp/dtspc-already-there ]
then
echo "dtspc\t6112/tcp\t#subprocess control" >>$FILE
else
rm /tmp/dtspc-already-there
fi
XCOMM
XCOMM remove legacy entries like dtspcd
XCOMM
$NAWK '{if ($1 == "dtspcd" || $1 == "#dtspcd")
;
else
print $0
}' $FILE >$TMPFILE
cp $TMPFILE $FILE
rm $TMPFILE
}
XCOMM Following inetdTT() procedure code from Sun CDE SI post_install
XCOMM configTT file. It updates the ToolTalk daemon inetd.conf
XCOMM line so it points to /usr/dt/bin/rpc.ttdbserverd.
inetdTT()
{
FILE=/etc/inetd.conf
TMPFILE=/tmp/inetd.conf
TTDBSERVERD=CDE_INSTALLATION_TOP/bin/rpc.ttdbserverd
XCOMM
XCOMM remove any non-dt ttdbserverd line
XCOMM
$NAWK -v ttdb=$TTDBSERVERD \
'{if ($1 == "100083/1" && $6 != ttdb)
;
else
print $0
}' $FILE >$TMPFILE
cp $TMPFILE $FILE
rm $TMPFILE
XCOMM
XCOMM add dt ttdbserverd line if its not already there
XCOMM
$NAWK '{if ($1 == "100083/1")
print $0 > "/tmp/tt-already-there"
}' $FILE >/dev/null
if [ ! -f /tmp/tt-already-there ]
then
echo "100083/1 stream rpc/tcp wait root $TTDBSERVERD $TTDBSERVERD" \
>>$FILE
else
rm /tmp/tt-already-there
fi
}
XCOMM Following owTT() procedure updates the ToolTalk daemon inetd.conf
XCOMM line so it points to /usr/openwin/bin/rpc.ttdbserverd.
owTT()
{
FILE=/etc/inetd.conf
TMPFILE=/tmp/inetd.conf
TTDBSERVERD=/usr/openwin/bin/rpc.ttdbserverd
XCOMM
XCOMM remove any non-ow ttdbserverd line
XCOMM
$NAWK -v ttdb=$TTDBSERVERD \
'{if ($1 == "100083/1" && $6 != ttdb)
;
else
print $0
}' $FILE >$TMPFILE
cp $TMPFILE $FILE
rm $TMPFILE
XCOMM
XCOMM add ow ttdbserverd line if its not already there
XCOMM
$NAWK '{if ($1 == "100083/1")
print $0 > "/tmp/tt-already-there"
}' $FILE >/dev/null
if [ ! -f /tmp/tt-already-there ]
then
echo "100083/1 stream rpc/tcp wait root $TTDBSERVERD $TTDBSERVERD" \
>>$FILE
else
rm /tmp/tt-already-there
fi
}
XCOMM Following inetdCM() procedure is from Sun CDE SI post_install
XCOMM configRun file. It updates the Calendar Manager daemon inetd.conf
XCOMM line so it points to /usr/dt/bin/rpc.cmsd.
inetdCM()
{
FILE=/etc/inetd.conf
TMPFILE=/tmp/inetd.conf
CMSD=CDE_INSTALLATION_TOP/bin/rpc.cmsd
XCOMM
XCOMM remove any non-dt rpc.cmsd line
XCOMM
$NAWK -v cmsd=$CMSD \
'{if ( ($1 == "100068/2-4" || $1 == "100068/2-5") && $6 != cmsd)
;
else
print $0
}' $FILE >$TMPFILE
cp $TMPFILE $FILE
rm $TMPFILE
XCOMM
XCOMM remove possible old dt cmsd level 2-4 entry
XCOMM
$NAWK -v cmsd=$CMSD \
'{if ($1 == "100068/2-4" && $6 == cmsd)
;
else
print $0
}' $FILE >$TMPFILE
cp $TMPFILE $FILE
rm $TMPFILE
XCOMM
XCOMM add dt cmsd line in needed
XCOMM
$NAWK -v cmsd=$CMSD \
'{if ($6 == cmsd && $1 == "100068/2-5")
print $0 > "/tmp/cmsd-already-there"
}' $FILE >/dev/null
if [ ! -f /tmp/cmsd-already-there ]
then
echo "100068/2-5 dgram rpc/udp wait root $CMSD rpc.cmsd" >>$FILE
else
rm /tmp/cmsd-already-there
fi
}
XCOMM Following owCM() procedure updates the Calendar Manager daemon inetd.conf
XCOMM line so it points to /usr/openwin/bin/cmsd.
owCM()
{
FILE=/etc/inetd.conf
TMPFILE=/tmp/inetd.conf
CMSD=/usr/openwin/bin/rpc.cmsd
XCOMM
XCOMM remove any non-ow rpc.cmsd line
XCOMM
$NAWK -v cmsd=$CMSD \
'{if ( ($1 == "100068/2-4" || $1 == "100068/2-5") && $6 != cmsd )
;
else
print $0
}' $FILE >$TMPFILE
cp $TMPFILE $FILE
rm $TMPFILE
XCOMM
XCOMM add openwin rpc.cmsd line if not already there
XCOMM
$NAWK -v cmsd=$CMSD \
'{if ( ($1 == "100068/2-4" || $1 == "100068/2-5") && $6 == cmsd )
print $0 > "/tmp/cmsd-already-there"
}' $FILE >/dev/null
XCOMM
XCOMM if it is not there, add it
XCOMM (note openwin cmsd is one rev back, its at level 2-4)
XCOMM
if [ ! -f /tmp/cmsd-already-there ]
then
echo "100068/2-4 dgram rpc/udp wait root $CMSD rpc.cmsd" >>$FILE
else
rm /tmp/cmsd-already-there
fi
}
case "$mode" in
'-d')
/usr/bin/rm -f $LEVEL_2_START
if [ -f $LEVEL_2_START ]; then
Message 12 "disable failed"
Message 13 "could not remove $LEVEL_2_START" $LEVEL_2_START
exit 1
fi
Message 14 "done"
Message 15 "desktop auto-start disabled."
;;
'-e')
if [ -f $RC_MASTER ]; then
/usr/bin/rm -f $RC_COPY
fi
if [ ! -x $RC_COPY ]; then
if [ ! -f $RC_MASTER ]; then
Message 16 "enable failed"
Message 17 "could not find $RC_MASTER" $RC_MASTER
exit 1
fi
/usr/bin/cp $RC_MASTER $RC_COPY
/usr/bin/chmod 0555 $RC_COPY
if [ ! -x $RC_COPY ]; then
Message 16 "enable failed"
Message 18 "could not create $RC_COPY" $RC_COPY
exit 1
fi
fi
/usr/bin/rm -f $LEVEL_0_KILL
/usr/bin/ln $RC_COPY $LEVEL_0_KILL
/usr/bin/rm -f $LEVEL_1_KILL
/usr/bin/ln $RC_COPY $LEVEL_1_KILL
/usr/bin/rm -f $LEVEL_2_START
/usr/bin/ln $RC_COPY $LEVEL_2_START
if [ ! -f $LEVEL_2_START ]; then
Message 16 "enable failed"
Message 19 "could not create $LEVEL_2_START" $LEVEL_2_START
exit 1
fi
Message 14 "done"
Message 20 "desktop auto-start enabled."
;;
'-inetd')
nawk_check
inetdSP
inetdCM
inetdTT
Message 14 "done"
Message 27 "Next system boot, following will be run from /usr/dt/bin"
Message 28 " rpc.ttdbserverd (ToolTalk)"
Message 29 " rpc.cmsd (Calendar Manager)"
Message 30 " dtspcd (Subprocess Control)"
;;
'-inetd.ow')
nawk_check
owCM
owTT
Message 14 "done"
Message 31 "Next system boot, following will be run from /usr/openwin/bin"
Message 32 " rpc.ttdbserverd (ToolTalk)"
Message 33 " rpc.cmsd (Calendar Manager)"
;;
'-kill')
rc_master_check
$RC_MASTER stop
Message 14 "done"
Message 21 "dtlogin kill complete."
;;
'-reset')
rc_master_check
$RC_MASTER reset
Message 14 "done"
Message 22 "dtlogin config resources reloaded."
;;
'-p')
rc_master_check
$RC_MASTER update_printers
Message 14 "done"
Message 23 "printer action update is complete"
;;
*)
echo " "
Message 24 "Usage:"
usage_error
exit 1
;;
esac
exit 0

View File

@@ -0,0 +1,130 @@
XCOMM!/bin/sh
XCOMM $XConsortium: dtlogin.rc.src /main/5 1996/04/23 12:12:17 drk $
XCOMM (c) Copyright 1996 Digital Equipment Corporation.
XCOMM (c) Copyright 1993,1994,1996 Hewlett-Packard Company.
XCOMM (c) Copyright 1993,1994,1996 International Business Machines Corp.
XCOMM (c) Copyright 1993,1994,1996 Sun Microsystems, Inc.
XCOMM (c) Copyright 1993,1994,1996 Novell, Inc.
XCOMM (c) Copyright 1996 FUJITSU LIMITED.
XCOMM (c) Copyright 1996 Hitachi.
XCOMM
XCOMM This version of the dtlogin.rc script can be used on the Solaris(TM)
XCOMM operating system to initiate CDE tasks such as starting the dtlogin
XCOMM process.
XCOMM
XCOMM Common Desktop Environment
XCOMM
XCOMM When placed in the /etc/rc2.d directory and named appropriately, such as
XCOMM "S99dtlogin", this script will automatically start the dtlogin window
XCOMM after the Solaris(TM) system boots to its multi-user level.
XCOMM
XCOMM This script is also called indirectly by the CDE dtconfig command.
mode=$1
usage_error() {
echo " $0 start (start dtlogin process)"
echo " $0 stop (stop dtlogin process)"
echo " $0 reset (reset dtlogin process)"
echo " $0 update_printers (update print actions)"
echo " "
}
if [ ! -d /usr/bin ]
then # /usr not mounted
exit 1
fi
set `/usr/bin/id`
if [ $1 != "uid=0(root)" ]; then
echo "$0: must be run as root"
exit 1
fi
XCOMM update_printers()
XCOMM
XCOMM Add print actions to workstation's database for all printer's known
XCOMM to this workstation if action is not already present in the database.
update_printers() {
if [ -x /usr/dt/bin/dtprintinfo ] ; then
/usr/dt/bin/dtprintinfo -populate
fi
}
XCOMM
XCOMM Find login server pid from the process tree
XCOMM
login_server_pid()
{
grep=/usr/bin/grep
ps=/usr/bin/ps
cut=/usr/bin/cut
awk=/usr/bin/awk
XCOMM In following grep for "dtlogin" processes, explictly exclude any matches
XCOMM on this shell file named "dtlogin.rc"
$ps -u 0 -l | $grep -v dtlogin. | $grep dtlogin | $cut -c1-24 | $awk '{print $4 " " $5}' |
while read pid ppid; do
parent_login_ps=`$ps -p $ppid | $grep dtlogin`
if [ -z "$parent_login_ps" ]; then
echo "$pid"
break
fi
done
}
case "$mode" in
'start')
update_printers
if [ -x CDE_INSTALLATION_TOP/bin/dtlogin ] ; then
CDE_INSTALLATION_TOP/bin/dtlogin &
fi
;;
'stop')
XCOMM get dtlogin pid
dtlogin_pid=`login_server_pid`
XCOMM kill dtlogin process
if [ "$dtlogin_pid" != "" ] ; then
/usr/bin/kill $dtlogin_pid
XCOMM reset keyboard back to ascii mode
if [ -x /usr/openwin/bin/kbd_mode ] ; then
/usr/openwin/bin/kbd_mode -a
fi
fi
;;
'reset')
XCOMM get dtlogin pid
dtlogin_pid=`login_server_pid`
XCOMM reset dtlogin process
if [ "$dtlogin_pid" != "" ] ; then
/usr/bin/kill -HUP $dtlogin_pid
fi
;;
'update_printers')
update_printers
;;
*)
usage_error
exit 1
;;
esac
exit 0