2 ################################################################################
5 # Description: ADL system configuration script
6 # To run this script you must have the pdl-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.
26 # 6.22.99 kel Added "bufpages 0" to the kernel config function. This is
27 # required if dynamic buffer cache sizes are being used.
29 ################################################################################
30 # Useful (hopefully) Comments Section
32 # This script will configure a system to operate nicely in the ADL
33 # infrastructure. This script requires the pdl-config.src file in order to
34 # run. The pdl-config.src file contains variables that determine exactly
35 # what type of optional software to install, which patch bundle to install,
36 # configures various system files, etc.
38 # Here is a brief description of what this script will do:
40 # 1) Check that the script is run as root
41 # 2) Check that the architecture is correct. The script will run on most
42 # hardware. The architecture is really only important when trying to
43 # determine which 100Mbit drivers to install.
44 # 3) Sources the input parameter source file.
45 # 4) Determine if script is run intereactive or not.
46 # 5) Determine if 100Mbit drivers are to be installed
47 # 6) If intereactive, greet the user and display the parameter settings.
48 # 7) Modify the kernel system file located in /stand/system
49 # 8) Download the shell archive file from the anonymous ftp server and unpack.
50 # The shell archive contains many files and symlinks and will not be
51 # listed here. See the README in the ahell archive build area and the shell
52 # archive itself for more details. One can also look through the "root"
53 # directory that is used to build the archive to see which files and
54 # symlinks are included.
55 # 9) Modify the /etc/rc.config.d files. (turn off unused stuff)
56 # 10) Modify the /etc/issue, /etc/gettydefs and /etc/motd files.
57 # 11) Modify miscellaneous files.
58 # 12) Perform miscellaneous setup procedures:
59 # a) Run /net/bismol/App/admin/bin/setup
60 # b) Run /usr/local/bin/ninstall -h bismol lp adm net3
61 # c) Run /usr/adm/netdist/netdaemon.dy
62 # d) Run /usr/sbin/catman -w
63 # 13) Set the system up for ClearCase installation upon automatic reboot.
64 # 14) Install optional software and patches from the specified depot server.
66 # END of Useful Comments Section
67 ################################################################################
74 SRC_FILE=/pdl-config.src
79 OS=`/bin/uname -r | /usr/bin/cut -c 3-4`
89 print -u2 "\t$BASE: Error: $1"
93 print -u2 "\t$BASE: Warning: $1"
101 display "\t$BASE [-usage]"
102 display " -usage: Print this usage message"
110 display "\tStep #$INDEX: $@"
114 step "Get shell archive from ftp server and unpack"
116 ftp -n $FTP_SERVER <<@EOD
117 user $FTP_USER $FTP_PASSWD
122 if [ $? -ne 0 ]; then
123 error "Unable to ftp $SHAR_FILE from $FTP_SERVER"
126 sh $SHAR_FILE >> $LOGFILE 2>&1
127 if [ $? -ne 0 ]; then
128 error "Cannot unpack shell archive."
131 /bin/rm -f $SHAR_FILE
134 function clearcase_setup {
135 if [ "$CLEARCASE" = "no" ]; then
136 /bin/rm -f /sbin/rc3.d/S998install_clearcase
137 /bin/rm -f /sbin/rc3.d/S999install_eclipse
142 if [ $(id -u) -ne 0 ]; then
143 error "Must be root to execute this command... Exiting!"
150 9000/7[1-3]*|9000/755|9000/7[7-8]*|9000/8**)
155 warning "\tUnknown machine type $ARCH, Exiting!"
162 if [ -a $SRC_FILE ]; then
181 error "Source file does not exist!"
187 case "$INTERACTIVE" in
198 if [ "_$ENET_DRVRS" = "_" ]; then
205 function mod_kernel {
206 step "Modify /stand/system file."
207 grep -v -E 'maxswapchunks|default_disk_ir|nstrpty' /stand/system \
209 /bin/mv /stand/system /stand/system.orig
210 /bin/mv /stand/system.new /stand/system
214 echo "bufpages 0" >> /stand/system
215 echo "create_fastlinks 1" >> /stand/system
216 echo "dbc_max_pct 25" >> /stand/system
217 echo "default_disk_ir 1" >> /stand/system
218 echo "fs_async 1" >> /stand/system
219 echo "maxdsiz (256*1024*1024)" >> /stand/system
220 echo "maxfiles 256" >> /stand/system
221 echo "maxfiles_lim 2048" >> /stand/system
222 echo "maxssiz (80*1024*1024)" >> /stand/system
223 echo "maxswapchunks 4096" >> /stand/system
224 echo "maxuprc 500" >> /stand/system
225 echo "maxusers 150" >> /stand/system
226 echo "netmemmax 0" >> /stand/system
227 echo "nfile 7000" >> /stand/system
228 echo "nflocks 400" >> /stand/system
229 echo "ninode 20000" >> /stand/system
230 echo "nproc 1500" >> /stand/system
231 echo "npty 512" >> /stand/system
232 echo "nstrpty 512" >> /stand/system
233 echo "semmns 200" >> /stand/system
234 if [ "$OS" = "10" ]; then
235 echo "large_ncargs_enabled 1" >> /stand/system
239 9000/7[7-8]*|9000/8**)
240 echo "bufpages 0" >> /stand/system
241 echo "create_fastlinks 1" >> /stand/system
242 echo "dbc_max_pct 25" >> /stand/system
243 echo "default_disk_ir 1" >> /stand/system
244 echo "fs_async 1" >> /stand/system
245 echo "maxdsiz (512*1024*1024)" >> /stand/system
246 echo "maxfiles 256" >> /stand/system
247 echo "maxfiles_lim 2048" >> /stand/system
248 echo "maxssiz (80*1024*1024)" >> /stand/system
249 echo "maxswapchunks 4096" >> /stand/system
250 echo "maxuprc 1000" >> /stand/system
251 echo "maxusers 256" >> /stand/system
252 echo "netmemmax 0" >> /stand/system
253 echo "nfile 14000" >> /stand/system
254 echo "nflocks 800" >> /stand/system
255 echo "ninode 40000" >> /stand/system
256 echo "nproc 3000" >> /stand/system
257 echo "npty 512" >> /stand/system
258 echo "nstrpty 512" >> /stand/system
259 echo "semmns 400" >> /stand/system
260 if [ "$OS" = "10" ]; then
261 echo "large_ncargs_enabled 1" >> /stand/system
266 warning "Unknown machine model $ARCH!"
267 warning "Leaving kernel parameters as default"
268 /bin/mv /stand/system.orig /stand/system
274 display "\tADL System Configuration script."
276 display "\tYou are about to install and modify various system files,"
277 display "\tinstall system patches, install optional software and,"
278 display "\tif you elected to do so, install ClearCase 3.2."
280 display "\tIf you wish to modify the parameters below exit the install"
281 display "\tand modify the parameters in the $SRC_FILE file."
283 display "\tMachine Name:\t\t\t$MACHINE_NAME"
284 display "\tMachine Usage:\t\t\t$MACHINE_USAGE"
285 display "\tMacine Location:\t\t$LOCATION"
286 display "\tOwner's Fullname:\t\t$OWNER_NAME"
287 display "\tOwner's Email:\t\t\t$OWNER_EMAIL"
288 display "\tOwner's Extension:\t\t$OWNER_EXTENSION"
289 display "\tInstall ClearCase?:\t\t$CLEARCASE"
290 display "\tInstall 100Mbit Drivers?:\t$FAST_ENET"
291 if [ "$SWINSTALL" = "yes" ]; then
292 display "\tThe following products will be installed from $DEPOT:"
293 display "\t$PRODUCTS"
298 if [ "$INTERACTIVE" = "yes" ]; then
299 display "\tContinue installation with these parameters (Y|n)?\c"
309 display "\tYou have chosen NOT to run the $BASE setup script...
317 function mod_rc_files {
318 /usr/sbin/ch_rc -ap AUDIO_SERVER=0 >> $LOGFILE 2>&1
319 /usr/sbin/ch_rc -ap LIST_TEMPS=0 >> $LOGFILE 2>&1
320 /usr/sbin/ch_rc -ap CLEAR_TMP=1 >> $LOGFILE 2>&1
321 /usr/sbin/ch_rc -ap HPARRAY_START_STOP=0 >> $LOGFILE 2>&1
322 /usr/sbin/ch_rc -ap NIS_CLIENT=1 >> $LOGFILE 2>&1
323 /usr/sbin/ch_rc -ap NIS_DOMAIN=pdl >> $LOGFILE 2>&1
324 /usr/sbin/ch_rc -ap START_LLBD=0 >> $LOGFILE 2>&1
325 /usr/sbin/ch_rc -ap NTPDATE_SERVER=cupertino.ntp.hp.com >> $LOGFILE 2>&1
326 /usr/sbin/ch_rc -ap XNTPD=1 >> $LOGFILE 2>&1
327 /usr/sbin/ch_rc -ap NETTL=0 >> $LOGFILE 2>&1
328 /usr/sbin/ch_rc -ap NUM_NFSIOD=16 >> $LOGFILE 2>&1
329 /usr/sbin/ch_rc -ap VTDAEMON_START=0 >> $LOGFILE 2>&1
330 if [ "$OS" = "10" ]; then
331 /usr/sbin/ch_rc -ap WAIT_FOR_NIS_SERVER=FALSE >> $LOGFILE 2>&1
335 function mod_etc_files {
336 step "/etc files setup"
337 print "+auto.master" > /etc/auto_master
338 /bin/chmod 644 /etc/auto_master
339 /bin/chown root:root /etc/auto_master
341 sed "s/GenericSysName/$MACHINE_NAME/" /etc/issue > /etc/issue-new
342 /bin/mv /etc/issue /etc/issue-orig
343 /bin/mv /etc/issue-new /etc/issue
345 sed "s/Console Login:/$MACHINE_NAME Console Login:/" /etc/gettydefs \
347 /bin/mv /etc/gettydefs /etc/gettydefs-orig
348 /bin/mv /etc/gettydefs-new /etc/gettydefs
350 /bin/banner $MACHINE_NAME > /etc/motd
351 /bin/uname -a >> /etc/motd
352 cat >> /etc/motd <<:END
354 *******************************************************************************
355 * This is a private system operated for the Hewlett-Packard Company
357 * Authorization from HP management is required to use this system.
359 * Use by unauthorized persons is prohibited.
362 *******************************************************************************
363 For System Support: Mon-Fri 8:00-5:00 Email (site-ux@cup.hp.com)
364 Phone: t-447-1212 After hours/weekend Pre-arrange: t-447-0629
366 -------------------------------------------------------------------------------
367 Usage: $MACHINE_USAGE
368 Owner: $OWNER_NAME ($OWNER_EMAIL) Phone: $OWNER_EXTENSION
371 -------------------------------------------------------------------------------
374 sed "s/Root user/Root\@$HOST/" /etc/passwd > /tmp/passwd-new
375 /bin/mv /tmp/passwd-new /etc/passwd
378 function mod_misc_files {
379 step "Miscellaneous file setup"
380 /bin/rm -f /var/adm/cron/at.allow
381 /bin/rm -f /var/adm/cron/cron.allow
382 /bin/chmod 644 /dev/lan*
383 case "$WORKSTATION" in
391 if [ "$WORKSTATION" = "yes" ]; then
392 /bin/sed -e "s/# \*/ \*/" Xservers > /tmp/Xservers-new
393 /bin/mv /tmp/Xservers-new /etc/dt/config/Xservers
394 /bin/chmod 444 /etc/dt/config/Xservers
395 /bin/chown root:other /etc/dt/config/Xservers
399 function misc_setup {
400 step "Setup Application Server"
401 /net/bismol/App/admin/bin/setup >> $LOGFILE 2>&1
403 step "Ninstalling lp, adm and net3 packages"
404 /usr/local/bin/ninstall -h bismol lp adm net3 >> $LOGFILE 2>&1
406 step "Run netdaemon.dy"
407 /usr/adm/netdist/netdaemon.dy >> $LOGFILE 2>&1
409 step "Create the whatis database"
410 /usr/sbin/catman -w >> $LOGFILE 2>&1
414 if [ "$SWINSTALL" = "yes" ]; then
415 step "Installing Patches and Optional Software, be patient!"
416 /usr/sbin/swinstall -s $DEPOT -x $OPTIONS $PRODUCTS $ENETDRVR >>
419 step "Rebuilding kernel with new parameters."
420 /usr/sbin/mk_kernel -v -o /stand/vmunix >> $LOGFILE 2>&1
421 step "Rebooting the system..."
423 /usr/sbin/shutdown -ry 0