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,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