2 ################################################################################
5 # Description: ADL system configuration script
6 # To run this script you must have the adl-config.src parameter
7 # file located in root. It is important that the source parameter
8 # file be read and understood before running the script.
9 # See below for useful comments.
10 # Author: Kevin Lister - kel@cup.hp.com
12 # Language: Korn Shell
14 # (c) Copyright 1991, Hewlett-Packard Company, all rights reserved.
17 # 3.25.99 kel Changed the name of the Clearcase install script in shell
18 # archive, so it had to be changed here as well. Added an
19 # eclipse install script to the shell archive, so a line to
20 # to remove it if Clearcase is not installed had to be added
22 # 4.1.99 kel Added code to determine if the installed system is going to have
23 # a graphics console. If yes, then the /etc/dt/config/Xservers
24 # file needs to have the console server line uncommented.
25 # Also added absolute paths to the unix commands.
27 ################################################################################
28 # Useful (hopefully) Comments Section
30 # This script will configure a system to operate nicely in the ADL
31 # infrastructure. This script requires the adl-config.src file in order to
32 # run. The adl-config.src file contains variables that determine exactly
33 # what type of optional software to install, which patch bundle to install,
34 # configures various system files, etc.
36 # Here is a brief description of what this script will do:
38 # 1) Check that the script is run as root
39 # 2) Check that the architecture is correct. The script will run on most
40 # hardware. The architecture is really only important when trying to
41 # determine which 100Mbit drivers to install.
42 # 3) Sources the input parameter source file.
43 # 4) Determine if script is run intereactive or not.
44 # 5) Determine if 100Mbit drivers are to be installed
45 # 6) If intereactive, greet the user and display the parameter settings.
46 # 7) Modify the kernel system file located in /stand/system
47 # 8) Download the shell archive file from the anonymous ftp server and unpack.
48 # The shell archive contains many files and symlinks and will not be
49 # listed here. See the README in the ahell archive build area and the shell
50 # archive itself for more details. One can also look through the "root"
51 # directory that is used to build the archive to see which files and
52 # symlinks are included.
53 # 9) Modify the /etc/rc.config.d files. (turn off unused stuff)
54 # 10) Modify the /etc/issue, /etc/gettydefs and /etc/motd files.
55 # 11) Modify miscellaneous files.
56 # 12) Perform miscellaneous setup procedures:
57 # a) Run /net/bismol/App/admin/bin/setup
58 # b) Run /usr/local/bin/ninstall -h bismol lp adm net3
59 # c) Run /usr/adm/netdist/netdaemon.dy
60 # d) Run /usr/sbin/catman -w
61 # 13) Set the system up for ClearCase installation upon automatic reboot.
62 # 14) Install optional software and patches from the specified depot server.
64 # END of Useful Comments Section
65 ################################################################################
73 SRC_FILE=/adl-config.src
78 OS=`/bin/uname -r | /usr/bin/cut -c 3-4`
88 print -u2 "\t$BASE: Error: $1"
92 print -u2 "\t$BASE: Warning: $1"
100 display "\t$BASE [-usage]"
101 display " -usage: Print this usage message"
109 display "\tStep #$INDEX: $@"
113 step "Get shell archive from ftp server and unpack"
115 ftp -n $FTP_SERVER <<@EOD
116 user $FTP_USER $FTP_PASSWD
121 if [ $? -ne 0 ]; then
122 error "Unable to ftp $SHAR_FILE from $FTP_SERVER"
125 sh $SHAR_FILE >> $LOGFILE 2>&1
126 if [ $? -ne 0 ]; then
127 error "Cannot unpack shell archive."
130 /bin/rm -f $SHAR_FILE
133 function clearcase_setup {
134 if [ "$CLEARCASE" = "NO" ]; then
135 /bin/rm -f /sbin/rc3.d/S998install_clearcase
136 /bin/rm -f /sbin/rc3.d/S999install_eclipse
141 if [ $(id -u) -ne 0 ]; then
142 error "Must be root to execute this command... Exiting!"
149 9000/7[1-3]*|9000/755|9000/7[7-8]*|9000/8**)
154 warning "\tUnknown machine type $ARCH, Exiting!"
161 if [ -a $SRC_FILE ]; then
180 error "Source file does not exist!"
186 case "$INTERACTIVE" in
197 if [ "_$ENET_DRVRS" = "_" ]; then
204 function mod_kernel {
205 step "Modify /stand/system file."
206 grep -v -E 'maxswapchunks|default_disk_ir|nstrpty' /stand/system \
208 /bin/mv /stand/system /stand/system.orig
209 /bin/mv /stand/system.new /stand/system
213 echo "create_fastlinks 1" >> /stand/system
214 echo "dbc_max_pct 25" >> /stand/system
215 echo "default_disk_ir 1" >> /stand/system
216 echo "fs_async 1" >> /stand/system
217 echo "maxdsiz (256*1024*1024)" >> /stand/system
218 echo "maxfiles 256" >> /stand/system
219 echo "maxfiles_lim 2048" >> /stand/system
220 echo "maxssiz (80*1024*1024)" >> /stand/system
221 echo "maxswapchunks 4096" >> /stand/system
222 echo "maxuprc 500" >> /stand/system
223 echo "maxusers 150" >> /stand/system
224 echo "netmemmax 0" >> /stand/system
225 echo "nfile 7000" >> /stand/system
226 echo "nflocks 400" >> /stand/system
227 echo "ninode 20000" >> /stand/system
228 echo "nproc 1500" >> /stand/system
229 echo "npty 512" >> /stand/system
230 echo "nstrpty 512" >> /stand/system
231 echo "semmns 200" >> /stand/system
232 if [ "$OS" = "10" ]; then
233 echo "large_ncargs_enabled 1" >> /stand/system
237 9000/7[7-8]*|9000/8**)
238 echo "create_fastlinks 1" >> /stand/system
239 echo "dbc_max_pct 25" >> /stand/system
240 echo "default_disk_ir 1" >> /stand/system
241 echo "fs_async 1" >> /stand/system
242 echo "maxdsiz (512*1024*1024)" >> /stand/system
243 echo "maxfiles 256" >> /stand/system
244 echo "maxfiles_lim 2048" >> /stand/system
245 echo "maxssiz (80*1024*1024)" >> /stand/system
246 echo "maxswapchunks 4096" >> /stand/system
247 echo "maxuprc 1000" >> /stand/system
248 echo "maxusers 256" >> /stand/system
249 echo "netmemmax 0" >> /stand/system
250 echo "nfile 14000" >> /stand/system
251 echo "nflocks 800" >> /stand/system
252 echo "ninode 40000" >> /stand/system
253 echo "nproc 3000" >> /stand/system
254 echo "npty 512" >> /stand/system
255 echo "nstrpty 512" >> /stand/system
256 echo "semmns 400" >> /stand/system
257 if [ "$OS" = "10" ]; then
258 echo "large_ncargs_enabled 1" >> /stand/system
263 warning "Unknown machine model $ARCH!"
264 warning "Leaving kernel parameters as default"
265 /bin/mv /stand/system.orig /stand/system
271 display "\tADL System Configuration script."
273 display "\tYou are about to install and modify various system files,"
274 display "\tinstall system patches, install optional software and,"
275 display "\tif you elected to do so, install ClearCase 3.2."
277 display "\tIf you wish to modify the parameters below exit the install"
278 display "\tand modify the parameters in the $SRC_FILE file."
280 display "\tMachine Name:\t\t\t$MACHINE_NAME"
281 display "\tMachine Usage:\t\t\t$MACHINE_USAGE"
282 display "\tMacine Location:\t\t$LOCATION"
283 display "\tOwner's Fullname:\t\t$OWNER_NAME"
284 display "\tOwner's Email:\t\t\t$OWNER_EMAIL"
285 display "\tOwner's Extension:\t\t$OWNER_EXTENSION"
286 display "\tInstall ClearCase?:\t\t$CLEARCASE"
287 display "\tInstall 100Mbit Drivers?:\t$FAST_ENET"
288 if [ "$SWINSTALL" = "yes" ]; then
289 display "\tThe following products will be installed from $DEPOT:"
290 display "\t$PRODUCTS"
295 if [ "$INTERACTIVE" = "yes" ]; then
296 display "\tContinue installation with these parameters (Y|n)?\c"
306 display "\tYou have chosen NOT to run the $BASE setup script...
314 function mod_rc_files {
315 /usr/sbin/ch_rc -ap AUDIO_SERVER=0 >> $LOGFILE 2>&1
316 /usr/sbin/ch_rc -ap LIST_TEMPS=0 >> $LOGFILE 2>&1
317 /usr/sbin/ch_rc -ap CLEAR_TMP=1 >> $LOGFILE 2>&1
318 /usr/sbin/ch_rc -ap HPARRAY_START_STOP=0 >> $LOGFILE 2>&1
319 /usr/sbin/ch_rc -ap NIS_CLIENT=1 >> $LOGFILE 2>&1
320 /usr/sbin/ch_rc -ap NIS_DOMAIN=adl >> $LOGFILE 2>&1
321 /usr/sbin/ch_rc -ap START_LLBD=0 >> $LOGFILE 2>&1
322 /usr/sbin/ch_rc -ap NTPDATE_SERVER=cupertino.ntp.hp.com >> $LOGFILE 2>&1
323 /usr/sbin/ch_rc -ap XNTPD=1 >> $LOGFILE 2>&1
324 /usr/sbin/ch_rc -ap NETTL=0 >> $LOGFILE 2>&1
325 /usr/sbin/ch_rc -ap NUM_NFSIOD=16 >> $LOGFILE 2>&1
326 /usr/sbin/ch_rc -ap VTDAEMON_START=0 >> $LOGFILE 2>&1
327 if [ "$OS" = "10" ]; then
328 /usr/sbin/ch_rc -ap WAIT_FOR_NIS_SERVER=FALSE >> $LOGFILE 2>&1
332 function mod_etc_files {
333 step "/etc files setup"
334 print "+auto.master" > /etc/auto_master
335 /bin/chmod 644 /etc/auto_master
336 /bin/chown root:root /etc/auto_master
338 sed "s/GenericSysName/$MACHINE_NAME/" /etc/issue > /etc/issue-new
339 /bin/mv /etc/issue /etc/issue-orig
340 /bin/mv /etc/issue-new /etc/issue
342 sed "s/Console Login:/$MACHINE_NAME Console Login:/" /etc/gettydefs \
344 /bin/mv /etc/gettydefs /etc/gettydefs-orig
345 /bin/mv /etc/gettydefs-new /etc/gettydefs
347 /bin/banner $MACHINE_NAME > /etc/motd
348 /bin/uname -a >> /etc/motd
349 cat >> /etc/motd <<:END
351 *******************************************************************************
352 * This is a private system operated for the Hewlett-Packard Company business. *
353 * Authorization from HP management is required to use this system. *
354 * Use by unauthorized persons is prohibited. *
355 *******************************************************************************
356 For System Support: Mon-Fri 8:00-5:00 Email (site-ux@cup.hp.com)
357 Phone: t-447-1212 After hours/weekend Pre-arrange: t-447-0629
358 -------------------------------------------------------------------------------
359 Usage: $MACHINE_USAGE
360 Owner: $OWNER_NAME ($OWNER_EMAIL) Phone: $OWNER_EXTENSION
362 -------------------------------------------------------------------------------
365 sed "s/Root user/Root\@$HOST/" /etc/passwd > /tmp/passwd-new
366 /bin/mv /tmp/passwd-new /etc/passwd
369 function mod_misc_files {
370 step "Miscellaneous file setup"
371 /bin/rm -f /var/adm/cron/at.allow
372 /bin/rm -f /var/adm/cron/cron.allow
373 /bin/chmod 644 /dev/lan*
374 case "$WORKSTATION" in
382 if [ "$WORKSTATION" = "yes" ]; then
383 /bin/sed -e "s/# \*/ \*/" Xservers > /tmp/Xservers-new
384 /bin/mv /tmp/Xservers-new /etc/dt/config/Xservers
385 /bin/chmod 444 /etc/dt/config/Xservers
386 /bin/chown root:other /etc/dt/config/Xservers
390 function misc_setup {
391 step "Setup Application Server"
392 /net/bismol/App/admin/bin/setup >> $LOGFILE 2>&1
394 step "Ninstalling lp, adm and net3 packages"
395 /usr/local/bin/ninstall -h bismol lp adm net3 >> $LOGFILE 2>&1
397 step "Run netdaemon.dy"
398 /usr/adm/netdist/netdaemon.dy >> $LOGFILE 2>&1
400 step "Create the whatis database"
401 /usr/sbin/catman -w >> $LOGFILE 2>&1
405 if [ "$SWINSTALL" = "yes" ]; then
406 step "Installing Patches and Optional Software, be patient!"
407 /usr/sbin/swinstall -s $DEPOT -x $OPTIONS $PRODUCTS $ENETDRVR >>
410 step "Rebuilding kernel with new parameters."
411 /usr/sbin/mk_kernel -v -o /stand/vmunix >> $LOGFILE 2>&1
412 step "Rebooting the system..."
414 /usr/sbin/shutdown -ry 0