2 XCOMM (c) Copyright 1993, 1994 International Business Machines Corp.
3 XCOMM @(#) $XConsortium: configMin.src /main/7 1996/04/23 10:35:44 drk $
5 XCOMM AIX cpp does not honor the usual requirement that preprocessor
6 XCOMM directives must begin in column one, so we must do more quoting.
14 DTSPCD=CDE_INSTALLATION_TOP/bin/dtspcd
18 XCOMM check for existence of /etc/services
21 if [ ! -f $SERVICES ] # highly unlikely
27 XCOMM check for existence of /etc/inetd.conf
30 if [ ! -f $INETD ] # highly unlikely
37 /usr/sbin/chservices -a -v dtspc -p tcp -n 6112 1>/dev/null 2>/dev/null
43 /usr/sbin/chsubserver -a -v dtspc -t stream -p tcp -w nowait -u root \
44 -g $DTSPCD -r inetd $DTSPCD 1>/dev/null 2>/dev/null
53 XCOMM Check if the server exists in the /etc/services file.
56 rc=`inetserv -s -S -v dtspc -p tcp 1>/dev/null 2>/dev/null;echo $?`
61 XCOMM Add entry into /etc/services file
63 inetserv -a -S -v dtspc -p tcp -n 6112
68 XCOMM Check if the server exists in the /etc/inetd.conf file.
70 rc=`inetserv -s -I -v dtspc -p tcp 1>/dev/null 2>/dev/null;echo $?`
74 inetserv -a -I -v dtspc -p tcp -t stream -w nowait -U root \
75 -r $DTSPCD -R $DTSPCD 1>/dev/null 2>/dev/null
80 XCOMM remove legacy entries like "dtspcd" if exist
83 rc=`inetserv -s -S -v dtspcd -p tcp 1>/dev/null 2>/dev/null;echo $?`
87 inetserv -D -S -v dtspcd -p tcp
92 CheckFordtspcService()
96 rc=`grep "dtspc" $SERVICES | cut -c1 | grep -xv "#" \
97 1>/dev/null 2>/dev/null;echo $?`
99 rc=`inetserv -s -S -v dtspc -p tcp 1>/dev/null 2>/dev/null;echo $?`
104 RemovedtspcFromInetserv()
106 DTSPCD=CDE_INSTALLATION_TOP/bin/dtspcd
110 /usr/sbin/chservices -d -v dtspc -p tcp -n 6112 1>/dev/null 2>/dev/null
116 /usr/sbin/chsubserver -d -v dtspc -t stream -p tcp -w nowait -u root \
117 -g $DTSPCD -r inetd $DTSPCD 1>/dev/null 2>/dev/null
125 XCOMM Check if the server exists in the /etc/services file.
128 rc=`inetserv -s -S -v dtspc -p tcp 1>/dev/null 2>/dev/null;echo $?`
132 inetserv -D -S -v dtspc -p tcp 2>/dev/null 1>/dev/null
136 XCOMM remove legacy entries like "dtspcd" if exist
139 rc=`inetserv -s -S -v dtspcd -p tcp 1>/dev/null 2>/dev/null;echo $?`
143 inetserv -D -S -v dtspcd -p tcp
151 ps -ef | fgrep $1 | grep -v grep >/tmp/tmppsout
152 if [ -s /tmp/tmppsout ]
154 awk '{print "kill " $2}' /tmp/tmppsout | /bin/ksh 1>/dev/null
156 ps -ef | fgrep $1 | grep -v grep >/tmp/tmppsout
157 if [ -s /tmp/tmppsout ]
159 awk '{print "kill -TERM " $2}' /tmp/tmppsout | /bin/ksh 1>/dev/null
161 ps -ef | fgrep $1 | grep -v grep >/tmp/tmppsout
162 if [ -s /tmp/tmppsout ]
164 awk '{print "kill -9 " $2}' /tmp/tmppsout | /bin/ksh 1>/dev/null
176 while [ $# -ne 0 ]; do
178 -e) DO_CONFIGURATION="yes"
181 -d) DO_CONFIGURATION="no"
188 XCOMM #################################################################
192 XCOMM #################################################################
201 XCOMM refresh the inetserv object class with the latest
202 XCOMM entries from /etc/inetd.conf and /etc/services files
212 if [ "$DO_CONFIGURATION" = "yes" ]
217 XCOMM create the /var/dt/tmp directory for the dtspcd
220 if [ ! -d CDE_LOGFILES_TOP/tmp ]
222 mkdir -p CDE_LOGFILES_TOP/tmp
230 echo "\n dtspc is already enabled...\n"
244 elif [ "$DO_CONFIGURATION" = "no" ]
251 RemovedtspcFromInetserv
253 echo "\n dtspc is already disabled...\n"