2 XCOMM (c) Copyright 1993, 1994 International Business Machines Corp.
3 XCOMM @(#) $XConsortium: configRun.src /main/7 1996/10/18 16:25:57 drk $
11 XCOMM The "sm" object definitions for 410 are in /usr/lib/objrepos so
12 XCOMM ODMDIR need to get set to the correct path name .
16 ODMDIR=/usr/lib/objrepos
19 CreateAppConfigDirectory()
22 XCOMM Create the APPCONFIG directory inside DT_CONFIG_TOP and create
23 XCOMM all of its subdirectories
27 if [ ! -d $APPCONFIG ]
34 for i in $APPCONFIG_DIRS
44 for j in $DT_TOP/$APPCONFIG/$i/STAR
46 if [ ! -d `basename $j` ]
56 CheckFor24cmsdinInetd()
60 rc=`grep "cmsd" $INETD | grep "2-4" | cut -c1 | grep -xv "#" \
61 1>/dev/null 2>/dev/null; echo $?`
63 rc=`inetserv -s -I -v cmsd -p udp | grep "2-4" 1>/dev/null 2>/dev/null;\
74 rc=`grep "cmsd" $INETD | cut -c1 | grep -xv "#" \
75 1>/dev/null 2>/dev/null;echo $?`
77 rc=`inetserv -s -I -v cmsd -p udp 1>/dev/null 2>/dev/null;echo $?`
85 odmdelete -o sm_cmd_opt -q"id='sysuiinterface'" 1>/dev/null 2>/dev/null
86 odmdelete -o sm_cmd_hdr -q"id='dtconfig'" 1>/dev/null 2>/dev/null
87 odmdelete -o sm_menu_opt -q"next_id='dtconfig'" 1>/dev/null 2>/dev/null
94 rc=`odmget -q"next_id='dtconfig'" sm_menu_opt | grep dtconfig 1>/dev/null 2>/dev/null;echo $?`
97 cat << odm_stanzas | odmadd
102 text = "Change System User Interface"
103 text_msg_file = "dtsmit.cat"
117 text = "Change System User Interface"
118 text_msg_file = "dtsmit.cat"
130 rc=`odmget -q"id='dtconfig'" sm_cmd_hdr | grep dtconfig 1>/dev/null 2>/dev/null;echo $?`
133 cat << odm_stanzas | odmadd
136 option_id = "sysuiinterface"
138 name = "Select System User Interface"
139 name_msg_file = "dtsmit.cat"
142 cmd_to_exec = "/usr/dt/bin/dtconfig "
147 cmd_to_discover_postfix = ""
157 rc=`odmget -q"id='sysuiinterface'" sm_cmd_opt | grep sysuiinterface 1>/dev/null 2>/dev/null;echo $?`
160 cat << odm_stanzas | odmadd
163 id = "sysuiinterface"
165 name = "Select System Login User Interface"
166 name_msg_file = "dtsmit.cat"
174 cmd_to_list_mode = ""
176 cmd_to_list_postfix = ""
179 disp_values = "CDE environment,Command line"
195 XCOMM Checks if portmap daemon is already running; if not
196 XCOMM starts the portmap daemon.
201 ps -ef | fgrep portmap | grep -v grep 2>/dev/null 1>/dev/null
210 ps -ef | fgrep $1 | grep -v grep >/tmp/tmppsout
211 if [ -s /tmp/tmppsout ]
213 awk '{print "kill " $2}' /tmp/tmppsout | /bin/ksh 1>/dev/null
215 ps -ef | fgrep $1 | grep -v grep >/tmp/tmppsout
216 if [ -s /tmp/tmppsout ]
218 awk '{print "kill -TERM " $2}' /tmp/tmppsout | /bin/ksh 1>/dev/null
220 ps -ef | fgrep $1 | grep -v grep >/tmp/tmppsout
221 if [ -s /tmp/tmppsout ]
223 awk '{print "kill -9 " $2}' /tmp/tmppsout | /bin/ksh 1>/dev/null
235 XCOMM now check to see if the proper entry is in /etc/rpc
243 HASH if the file doesn't exist (highly unlikely), make one
244 HASH with the proper entry
247 echo "cmsd 100068 dtcalendar" >$RPCFILE
251 HASH check to see if the entry is already there
254 awk '{if ($1 == "cmsd" && $2 == "100068")
255 print $0 > "/tmp/etc-rpc-already-there"
256 }' $RPCFILE >/dev/null
258 if [ ! -f /tmp/etc-rpc-already-there ]
261 HASH if it isn't, check to see if either term already
265 awk '{if ($1 == "cmsd" || $2 == "100068")
266 print $0 > "/tmp/etc-rpc-already-there"
267 }' $RPCFILE >/dev/null
270 HASH if either one does they need to be commented out
273 if [ ! -f /tmp/etc-rpc-already-there ]
275 echo "cmsd 100068 dtcalendar" >>$RPCFILE
277 awk '{if ($1 == "cmsd" || $2 == "100068")
281 }' $RPCFILE >$TMPFILE
283 echo "cmsd 100068 dtcalendar" >>/tmp/etc-rpc
285 rm /tmp/etc-rpc-already-there
288 rm /tmp/etc-rpc-already-there
298 awk '{if ($1 == "cmsd" && $2 == "100068")
306 awk '{if ($1 == "#cde" && ($2 == "cmsd" || $3 == "100068"))
315 Remove24cmsdFromInetd()
318 CMSD=CDE_INSTALLATION_TOP/bin/rpc.cmsd
322 /usr/sbin/chsubserver -d -v cmsd -t sunrpc_udp -p udp -w wait -u root \
323 -g $CMSD -r inetd cmsd 100068 2-4 1>/dev/null 2>/dev/null
324 grep -v "#cmsd" $INETD >/tmp/configRun.$$ && mv /tmp/configRun.$$ $INETD
328 inetserv -D -I -v cmsd -p udp 2>/dev/null 1>/dev/null
339 RemovecmsdFromInetserv()
342 CMSD=CDE_INSTALLATION_TOP/bin/rpc.cmsd
346 /usr/sbin/chsubserver -d -v cmsd -t sunrpc_udp -p udp -w wait -u root \
347 -g $CMSD -r inetd cmsd 100068 2-5 1>/dev/null 2>/dev/null
349 grep -v "#cmsd" $INETD >/tmp/configRun.$$ && mv /tmp/configRun.$$ $INETD
353 inetserv -D -I -v cmsd -p udp 2>/dev/null 1>/dev/null
366 CMSD=CDE_INSTALLATION_TOP/bin/rpc.cmsd
369 XCOMM check for existence of /etc/inetd.conf
372 if [ ! -f $INETD ] # highly unlikely
380 /usr/sbin/chsubserver -a -v cmsd -t sunrpc_udp -p udp -w wait -u root \
381 -g $CMSD -r inetd cmsd 100068 2-5 1>/dev/null 2>/dev/null
391 XCOMM Check if the server exists in the /etc/inetd.conf file.
393 rc=`inetserv -s -I -v cmsd -p udp 1>/dev/null 2>/dev/null;echo $?`
397 inetserv -a -S -v cmsd -p udp -n 111
401 inetserv -a -I -v cmsd -p udp -t sunrpc_udp -w wait -U root \
402 -r $CMSD -R "cmsd 100068 2-5"
414 while [ $# -ne 0 ]; do
416 -e) DO_CONFIGURATION="yes"
419 -d) DO_CONFIGURATION="no"
430 rm -f $DT_TOP/$APPCONFIG/icons/C/F$SRC
431 ln -s $DT_TOP/$APPCONFIG/icons/C/$SRC $DT_TOP/$APPCONFIG/icons/C/F$SRC
443 ConfigurePrintersDir()
445 cd $DT_TOP/$APPCONFIG/appmanager
447 XCOMM for each locale
455 HASH for each directory in the locale, check for a
456 HASH localized version of the Printers directory
457 HASH and for the file lp_Print within that directory
461 if [ -f $j/$DEFAULT_PRINTER ]
466 HASH make the equivalent directory in the configuration
469 if [ ! -d $DT_CONFIG_TOP/$APPCONFIG/appmanager/$i ]
471 mkdir $DT_CONFIG_TOP/$APPCONFIG/appmanager/$i
473 cd $DT_CONFIG_TOP/$APPCONFIG/appmanager/$i
474 if [ ! -d $DT_CONFIG_TOP/$APPCONFIG/appmanager/$i/$PRINTERS ]
476 mkdir $DT_CONFIG_TOP/$APPCONFIG/appmanager/$i/$PRINTERS
478 cd $DT_CONFIG_TOP/$APPCONFIG/appmanager/$i/$PRINTERS
480 HASH now copy the file over from the installation dirctory
481 HASH if it is not already present.
483 if [ ! -f $DEFAULT_PRINTER ]
485 cp $DT_TOP/$APPCONFIG/appmanager/$i/$PRINTERS/$DEFAULT_PRINTER .
487 cd $DT_TOP/$APPCONFIG/appmanager/$i
490 cd $DT_TOP/$APPCONFIG/appmanager
496 XCOMM ##########################################################################
500 XCOMM ##########################################################################
508 DT_CONFIG_TOP=/etc/dt
516 APPCONFIG_DIRS="appmanager help icons types"
518 DEFAULT_PRINTER="DtPrint"
521 StopDaemon "rpc.cmsd"
526 if [ "$DO_CONFIGURATION" = "yes" ]
531 XCOMM create the /var/dt directory
533 if [ ! -d $DT_TEMP_TOP/$APPCONFIG/appmanager ]
535 mkdir -p $DT_TEMP_TOP/$APPCONFIG/appmanager
538 mv $APPCONFIG/appmanager .hidden-appmanager
539 chmod -R 755 * 2> /dev/null
540 chmod 755 .hidden-appmanager 2> /dev/null
541 chown -R bin * 2> /dev/null
542 chgrp -R bin * 2> /dev/null
543 mv .hidden-appmanager $APPCONFIG/appmanager
544 chmod 755 . 2> /dev/null
545 chown bin . 2> /dev/null
546 chgrp bin . 2> /dev/null
549 XCOMM create the /etc/dt and its config directory
551 if [ ! -d $DT_CONFIG_TOP ]
553 mkdir -p $DT_CONFIG_TOP
555 if [ ! -d $DT_CONFIG_TOP/config ]
557 mkdir -p $DT_CONFIG_TOP/config
560 CreateAppConfigDirectory
564 env LANG=C /usr/dt/bin/dtprintinfo -populate
567 XCOMM Configure Xsession.d
570 cd $DT_CONFIG_TOP/config
571 if [ ! -d Xsession.d ]
587 XCOMM After adding the Calendar Manager to the rpc service list the
588 XCOMM portmapper needs to be restarted.
594 CheckFor24cmsdinInetd
598 Remove24cmsdFromInetd
610 RemovecmsdFromInetserv
617 XCOMM After adding the Calendar Manager to the inetd service list, the inet
618 XCOMM daemon needs to reread its configuration.
626 elif [ "$DO_CONFIGURATION" = "no" ]
635 XCOMM After deleting the Calendar Manager to the rpc service list the
636 XCOMM portmapper needs to be restarted.
646 RemovecmsdFromInetserv
648 echo "\ncmsd is already disabled..\n"
654 XCOMM After adding the Calendar Manager to the inetd service list, the inet
655 XCOMM daemon needs to reread its configuration.