#!/bin/sh # creation date: December 24, 1998 # updated: june 11, 2001 # author: John Meister # filename: /dskarray/sa/setup/setuphp # # 1 2 3 4 5 6 7 8 9 #23456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 # # file location: /dskarray/sa/setup/setuphp # # ======================================================================== # To build an HP workstation: (John Meister) # ======================================================================== # # summary: # # /-------------------------------------------------------------------------\ # | initial load of operating system ______ | # | log in as root, setup root, ftp files, setuphp ______ | # | REBOOT | # | configure default printer via SAM ______ | # | add install patches/applications from hp-srv02 DEPOT ______ | # | REBOOT | # \_________________________________________________________________________/ # # 1) mount the 10.20 ACE CD (DEC 99 or newer) # power off, attach or insert CD, power up, press esc to stop boot # # 2) boot from the CD ("b p1" or as designated from search) # SEArch for drive, (varies) # boot from CD: "b p1" or "b scsi.2.0" # # - do not interact with IPL # - NO DHCP (ctrl c to break out) (the evil /sbin/auto_parms) # - PS2_DIN_US English #61 (or 26) # - Load ACE enhancements = True # answer true to load 10.20 ACE Networking # - NO home # # 3) set the ip address: # hostip: 192.168.10.___ # gateway: 192.168.0.1 gate70 # subnet mask: 255.255.255.0 # # 4) set the filesystems as follows: LVM with VxFS: # # NOTE, filesystems are specified for 4 gig and 9 gig drives. # # use LVM, Vxfs: (VARIES) # FILESYSTEMS default 4 gig 9 gig (if more space) # ================================================== # / 84m 100 1024 (make larger) # /stand 48m 84 104 # pri swap 512m 512 512 # sec swap 512m 512 512 # /opt 252m 512 2048 # /tmp 32m 480 1024 (make larger) # /usr 492m 744 1400 # /var 300m 1024 2048 (make larger) # ========================================================== # # 5) after loading system, answer questions, careful: CHECK TIME!!! # # 6) mkdir /sbin/root, cd /sbin/root # vi /etc/passwd - add /sbin/root; mv /.* /sbin/root # # 7) ftp from hp-srv02 # hp-srv02:/dskarray/sa/setup "dt.tar, checklst and setuphp" # # 8) setup root's account # rm -rf .dt; tar xvf dt.tar; # try: sh setuphp (or sh ./setuphp), if fails, then # chmod 750 setuphp; ./setuphp # need to /etc/shutdown -ry 0 when done # (to halt system, /etc/shutdown -hy 0 ) # # 9) enter SAM, add "laserjet" as nearest local printer, make default # Add Remote Printer/Plotter # # Printer Name: "laserjet" # System Name: "printer name" (automatically adds ".intermec.com") # Printer Name: "printer name" # # Allow Cancel, make "laserjet" default # # 10) enter sam, install from latest Depot on hp-srv02 (see john) # (this includes current patches, Online JFS and other tools) # # # 1 2 3 4 5 6 7 8 9 #23456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 ################################################################################## /usr/bin/echo "set up of workstation started ..." /usr/bin/mkdir /sbin/superuser/History /usr/bin/mv /.v* /sbin/root /usr/bin/mv /.p* /sbin/root /usr/bin/mv /.s* /sbin/root /usr/bin/mv /.X* /sbin/root /usr/bin/mv /.d* /sbin/root touch /sbin/superuser/setuplog.`date +'%y%m%d-%H'` /usr/bin/echo "# =======================================" \ >> /sbin/superuser/setuplog.`date +'%y%m%d-%H'` /usr/bin/date | /usr/bin/tee -a /sbin/superuser/setuplog.`date +'%y%m%d-%H'` /usr/bin/uname -a | /usr/bin/tee -a /sbin/superuser/setuplog.`date +'%y%m%d-%H'` /usr/bin/echo "# =======================================" \ >> /sbin/superuser/setuplog.`date +'%y%m%d-%H'` if [ ! -d /dskarray/01 ] then /usr/bin/mkdir /dskarray /usr/bin/mkdir /dskarray/apps /usr/bin/mkdir /dskarray/archive /usr/bin/mkdir /dskarray/ecadarchive /usr/bin/mkdir /dskarray/sa /usr/bin/mkdir /dskarray/web /usr/bin/mkdir /dskarray/home01 /usr/bin/mkdir /dskarray/home02 /usr/bin/mkdir /dskarray/home03 /usr/bin/mkdir /dskarray/home04 /usr/bin/mkdir /dskarray/home05 /usr/bin/mkdir /dskarray/home06 /usr/bin/mkdir /dskarray/home07 /usr/bin/mkdir /dskarray/home08 /usr/bin/mkdir /dskarray/home09 /usr/bin/mkdir /dskarray/home10 /usr/bin/mkdir /dskarray/home11 /usr/bin/mkdir /dskarray/home12 /usr/bin/mkdir /dskarray/01 /usr/bin/mkdir /dskarray/03a /usr/bin/mkdir /dskarray/03b /usr/bin/mkdir /dskarray/03c # making link for dwg-release - dskarray/03d no longer active on dskarray /usr/bin/mkdir /dskarray/03d /usr/bin/ln -s /dskarray/01/dwg-release /dskarray/03d/dwg-release /usr/bin/mkdir /dskarray/04c /usr/bin/mkdir /opt/workmanager /usr/bin/mkdir /dskarray/workmanager_release fi /usr/bin/mv /var/mail /var/mail.orig /usr/bin/ln -s /dskarray/03b/mail /var/mail /usr/bin/echo "directories made" /usr/sbin/mount hp-srv02:/dskarray/sa /dskarray/sa /usr/bin/bdf | /usr/bin/grep dskarray/sa if [ ! ? ] then echo "MOUNT FAILED" /usr/bin/echo " ############################################################## " echo "press to continue, ctrl c to exit" /usr/bin/echo " IF NOT CONNECTED TO RAID: FAILS AT THIS POINT!!!" /usr/bin/echo " ############################################################## " read $answer1 /usr/sbin/mount hp-srv02:/dskarray/sa /dskarray/sa fi /usr/bin/cp /sbin/superuser/.profile /sbin/superuser/orig.profile-`date +'%y%m%d-%H'` /usr/bin/cp /dskarray/sa/setup/rootprofile /sbin/superuser/.profile /usr/bin/cp /dskarray/sa/setup/dtprofile /sbin/superuser/.dtprofile /usr/bin/cp /dskarray/sa/setup/rhosts /sbin/superuser/.rhosts if [ ! -f /etc/fstab.orig ] then /usr/bin/cp /etc/fstab /etc/fstab.orig fi /usr/bin/echo "# =========== nfs mounts added =========" >> /etc/fstab /usr/bin/cat /dskarray/sa/setup/checklst >> /etc/fstab /usr/bin/cp /etc/fstab /etc/fstab.`date +'%y%m%d-%H'` /etc/mount -a # # test mounting of filesystems # /usr/bin/bdf | /usr/bin/tee -a /sbin/superuser/setuplog.`date +'%y%m%d-%H'` # # IF NOT CONNECTED TO RAID THIS SCRIPT WILL FAIL AT THIS POINT!!! # /usr/bin/cp /etc/hosts /etc/hosts.orig # # create links for SolidDesigner # creating lib700 links to make Solid Designer work # if [ ! -d /usr/PE ] then /usr/bin/mkdir /usr/PE fi if [ ! -d /opt/CoCreate ] then /usr/bin/mkdir /opt/CoCreate fi if [ ! -h /usr/PE/lib700 ] then /usr/bin/ln -s /dskarray/apps/lib700 /usr/PE/lib700 fi if [ ! -h /opt/CoCreate/lib700 ] then /usr/bin/ln -s /dskarray/apps/lib700 /opt/CoCreate/lib700 fi # # setting up DNS, sendmail and name resolution # if [ ! -h /etc/nsswitch.conf ] then /usr/bin/mv /etc/nsswitch.conf /etc/orig-nsswitch.conf fi # link nsswitch.conf to dskarray on hp-srv02 /usr/bin/ln -s /dskarray/sa/setup/nsswitch.conf /etc/nsswitch.conf # link resolv.conf to dskarray on hp-srv02 /usr/bin/mv /etc/resolv.conf /etc/orig-resolv.conf /usr/bin/ln -s /dskarray/sa/setup/resolv.conf /etc/resolv.conf # stop sendmail to make changes /sbin/init.d/sendmail stop # link sendmail.cf to dskarray on hp-srv02 /usr/bin/mv /etc/mail/sendmail.cf /etc/mail/orig-sendmail.cf /usr/bin/ln -s /dskarray/sa/setup/sendmail.cf /etc/mail/sendmail.cf /usr/bin/mv /etc/mail/aliases /etc/mail/orig-aliases /usr/bin/ln -s /dskarray/sa/setup/aliases /etc/mail/aliases # update aliases for sendmail /usr/sbin/newaliases # restart sendmail /sbin/init.d/sendmail start # configure CDE - make copies of original files # # link /etc/PATH to dskarray on hp-srv02 if [ ! -h /etc/PATH ] then /usr/bin/mv /etc/PATH /etc/orig-PATH fi /usr/bin/ln -s /dskarray/sa/setup/PATH /etc/PATH # this file is in a critical directory, do not leave backup files here or links /usr/bin/cp /dskarray/sa/setup/list_mode /etc/rc.config.d/list_mode # # 1 2 3 4 5 6 7 8 9 #23456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 # # # set up new files # /usr/bin/ln -s /dskarray/sa/setup/sys.resources \ /etc/dt/config/C/sys.resources /usr/bin/ln -s /dskarray/sa/setup/sys.dtwmrc \ /etc/dt/config/C/sys.dtwmrc /usr/bin/cp /dskarray/sa/setup/0010.sourceprofile \ /etc/dt/config/Xsession.d/ # # add Xconfig file to prevent from losing MIT-MAGIC COOKIE # if this file is missing it will cause login problems and X related issues # /usr/bin/echo "Dtlogin*authorize: False" > /etc/dt/config/Xconfig /usr/bin/chmod 444 /etc/dt/config/Xconfig # # link motd to dskarray on hp-srv02 # /usr/bin/ln -s /dskarray/sa/setup/motd /etc/motd # /usr/bin/cp /dskarray/sa/setup/shells /etc/shells /usr/bin/cp /etc/csh.login /etc/csh.login.orig /usr/bin/echo "# " >> /etc/csh.login /usr/bin/echo "set autologout = 0" >> /etc/csh.login /usr/bin/cp /etc/csh.login /etc/csh.login.`date +'%y%m%d-%H'` # link profile to dskarray on hp-srv02 to allow updates if [ ! -h /etc/profile ] then /usr/bin/mv /etc/profile /etc/orig-profile fi /usr/bin/ln -s /dskarray/sa/setup/etcprofile /etc/profile /usr/bin/cp /etc/profile /etc/profile.`date +'%y%m%d-%H'` # ############## ############## # NIS setup - passwd - group ############## ############## /usr/bin/cp /etc/passwd /etc/passwd.orig /usr/bin/cp /etc/passwd /etc/passwd.`date +'%y%m%d-%H'` /usr/bin/grep 60001 /etc/passwd if [ ? ] then /usr/bin/echo "brroot:5v9Fcm2ZQnPSs:0:3:support:/sbin/superuser/br/:/sbin/sh" >> /etc/passwd /usr/bin/echo "+::-2:60001:::" >> /etc/passwd echo "passwd is now set for NIS and br" fi /usr/bin/grep 60001 /etc/passwd if [ ! ? ] then echo "passwd was set to NIS already, no change" fi /usr/bin/cp /etc/passwd /sbin/superuser/passwd.`date +'%y%m%d-%H'` if [ ! -f /etc/group.orig ] then /usr/bin/cp /etc/group /etc/group.orig fi /usr/bin/grep "+:*:*" /etc/group if [ ? ] then /usr/bin/echo "+:*:*" >> /etc/group echo "group is now set for NIS" fi /usr/bin/cp /etc/group /etc/group.`date +'%y%m%d-%H'` /usr/bin/cp /etc/group /sbin/superuser/group.`date +'%y%m%d-%H'` /usr/bin/grep "+:*:*" /etc/group if [ ! ? ] then echo "group is already set for NIS, no change" fi ############## ############## # ports for SD Help and SAP (in NIS, this is a failover feature) ############## ############## if [ ! -f /etc/services.orig ] then /usr/bin/cp /etc/services /etc/services.orig fi /usr/bin/cp /etc/services /etc/services.`date +'%y%m%d-%H'` /usr/bin/grep sdhelp /etc/services if [ ? ] then /usr/bin/echo "sdhelp 2308/tcp #sdhelp for SolidDesigner" >> /etc/services fi # 1 2 3 4 5 6 7 8 9 #23456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 /usr/bin/grep sapdp00 /etc/services if [ ? ] then /usr/bin/echo "sapdp00 3200/tcp # for SAP " >> /etc/services fi ############## ############## # add ntp and plottr plotters ############## ############## /usr/sbin/lpshut /usr/sbin/lpshut sleep 2 ########## define spools using lpadmin ########################### # >--> lpadmin # usages: lpadmin -pprinter [-vdevice] [-cclass] [-rclass] # [-eprinter|-iinterface|-mmodel] [-h|-l] # [-ociinterface|-ocmmodel] [-ob3] # [-osiinterface|-osmmodel] [-orc] [-ormmachine|-orpprinter] # lpadmin -d[destination] # lpadmin -xdestination # # lpadmin -p_ - orm__ -orm__ -orp__ -v/dev/null -mrmmodel -ocmrcmodel -osmrsmodel # # # ################################################################################## # # setting up only printers/plotters: plottr8830, dj750, laser5, baker, navaho, # owl, bwprt, eprt2d10 and mr_color # # ################################################################################## # DIRECT, not through hp-srv04: ################################################################################## echo "setting up Printer queue plottr8830" /usr/sbin/lpadmin -pplottr8830 -v/dev/null -mrmodel -ocmrcmodel \ -osmrsmodel -ormedocplt2D10 -orpraw ################################################################################## # through hp-srv04: ( ONLY for engineering or the 192.168.subnet ) ################################################################################## echo "setting up Printer queue for eprt2d10" /usr/sbin/lpadmin -peprt2d10 -v/dev/null -mrmodel -ocmrcmodel \ -osmrsmodel -ormhp-srv04 -orpeprt2d10 echo "setting up Printer queue for mr_color " /usr/sbin/lpadmin -pmr_color -v/dev/null -mrmodel -ocmrcmodel \ -osmrsmodel -ormhp-srv04 -orpmr_color -ob3 echo "setting up Printer queue for dj750" /usr/sbin/lpadmin -pdj750 -v/dev/null -mrmodel -ocmrcmodel \ -osmrsmodel -ormhp-srv04 -orpdj750 -ob3 echo "setting up Printer queue for laser5" /usr/sbin/lpadmin -plaser5 -v/dev/null -mrmodel -ocmrcmodel \ -osmrsmodel -ormhp-srv04 -orplaser5 echo "setting up Printer queue for baker" /usr/sbin/lpadmin -pbaker -v/dev/null -mrmodel -ocmrcmodel \ -osmrsmodel -ormhp-srv04 -orpbaker echo "setting up Printer queue for bwprt" /usr/sbin/lpadmin -pbwprt -v/dev/null -mrmodel -ocmrcmodel \ -osmrsmodel -ormhp-srv04 -orpbwprt echo "setting up Printer queue for owl" /usr/sbin/lpadmin -powl -v/dev/null -mrmodel -ocmrcmodel \ -osmrsmodel -ormhp-srv04 -orpowl ##### accept and enable /usr/sbin/lpsched /usr/sbin/accept plottr8830 /usr/bin/enable plottr8830 echo "Printer queue plottr8830 is now setup" /usr/sbin/accept laser5 /usr/bin/enable laser5 echo "Printer queue laser5 is now setup" /usr/sbin/accept dj750 /usr/bin/enable dj750 echo "Printer queue dj750 is now setup" /usr/sbin/accept baker /usr/bin/enable baker echo "Printer queue baker is now setup" /usr/sbin/accept owl /usr/bin/enable owl echo "Printer queue owl is now setup" /usr/sbin/accept bwprt /usr/bin/enable bwprt echo "Printer queue bwprt is now setup" /usr/sbin/accept mr_color /usr/bin/enable mr_color echo "Printer queue mr_color is now setup" /usr/sbin/accept eprt2d10 /usr/bin/enable eprt2d10 echo "Printer queue for eprt2d10 is now setup" ################ ntp echo "Now setting up ntp..." echo "server hp-srv02 prefer" >> /etc/ntp.conf cp /dskarray/sa/setup/netdaemons /etc/rc.config.d/netdaemons chmod 444 /etc/rc.config.d/netdaemons chown bin /etc/rc.config.d/netdaemons /sbin/init.d/xntpd stop /sbin/init.d/xntpd start # # prevent hang for dhcp (this file is evil) chmod 444 /sbin/auto_parms ######################################################## # CNC ONLY: # add to /etc/passwd: cnc:W6DVkyur33O6k:207:20:,,,:/users/cnc:/usr/bin/sh # add to /etc/hosts: gomez tuesday fester lurch # uncomment ug lines in /etc/profile # run UG config found, uncomment next line: (this is for version 15) # /dskarray/apps/UG/ugs150/install/ug_install -c # base directory: /dskarray/apps/UG/ugs150 # UGFLEXlm server: 27000 atsign hp-srv01 # uncomment following lines: # /usr/bin/ln -s /dskarray/04c/cnc /users ######################################################## # 1 2 3 4 5 6 7 8 9 #23456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 /usr/bin/echo " ##################################################################" /usr/bin/echo " initial install and setup done, continue: " /usr/bin/echo " 1) REBOOT and then enter SAM" /usr/bin/echo " 2) set laserjet to local printer via Printers" /usr/bin/echo " 3) install software via SAM from latest hp-srv02:/dskarray/DEPOT/ " /usr/bin/echo " 4) you may need to: /usr/sbin/swconfig /var/adm/sw/patch/*" /usr/bin/echo " ################################################################## " # the following command may be used to install software, use with caution. # swinstall -x autoreboot=true -x match_target=true -s hp-srv02:/dskarray/DEPOT/June-2000-700 \* # /usr/sbin/swconfig /var/adm/sw/patch/*