/* REXX */ /**********************************************************************/ /* This exec will customize the Version Root HFS for z/OS v1r7 */ /**********************************************************************/ parse arg $root . say "CUSTHFS: Starting" if length($root) = 0 then do say "ERROR: You must supply the path where the root hfs is mounted" say "Example: EXEC 'D10.PETHFSN.JOBS(CUSTHFSn)' '/service'" say "CUSTHFS: All done." exit 20 end /*********************************************************************/ /* Turn on syscalls */ /*********************************************************************/ call syscalls 'ON' say 'Customizing HFS mounted at '$root say "Creating directories for the Version HFS" call makedir $root'/usr/lpp/cicsts' 755 address syscall say "Change group owner to TTY for mesg, talk and write" 'getgrnam TTY ttygrp.' 'chown '$root'/bin/mesg -1 'ttygrp.gr_gid 'chown '$root'/bin/talk -1 'ttygrp.gr_gid 'chown '$root'/bin/write -1 'ttygrp.gr_gid say "Turn on setgid bit for mesg, talk and write" 'chmod '$root'/bin/mesg 2755 ' /* g+s */ 'chmod '$root'/bin/talk 2755 ' /* g+s */ 'chmod '$root'/bin/write 2755 ' /* g+s */ say "Creating symbolic links for the Version HFS" 'symlink /dce '$root'/usr/dce' 'symlink /mmfacts '$root'/usr/mmfacts' 'symlink /CB390 '$root'/usr/lpp/CB390' 'symlink /cicsts/cicsts13 '$root'/usr/lpp/cicsts/cicsts13' 'symlink /db2 '$root'/usr/lpp/db2' 'symlink /awm110 '$root'/usr/lpp/awm' 'symlink $SYSNAME/fwdata '$root'/usr/lpp/fw/fwdata' 'symlink $SYSNAME/fwkern '$root'/usr/lpp/fw/fwkern' 'symlink $SYSNAME/home '$root'/usr/lpp/fw/home' 'symlink $SYSNAME/IMiner '$root'/usr/lpp/IMiner' 'symlink /java '$root'/usr/lpp/java' 'symlink /java/java13 '$root'/usr/lpp/java13' 'symlink /PolicyDirector '$root'/usr/lpp/PolicyDirector' 'symlink $SYSNAME/lotus '$root'/usr/lpp/lotus' 'symlink /NetCommerce '$root'/usr/lpp/NetCommerce' 'symlink /netdata '$root'/usr/lpp/netdata' 'symlink $SYSNAME/nstation '$root'/usr/lpp/nstation' 'symlink $SYSNAME/Tivoli2 '$root'/usr/lpp/Tivoli2' 'symlink $SYSNAME/Tivoli2db '$root'/usr/lpp/Tivoli2db' 'symlink $SYSNAME/Tivoli2ir '$root'/usr/lpp/Tivoli2ir' 'symlink $SYSNAME/Tivoli2bk '$root'/usr/lpp/Tivoli2bk' 'symlink /Tivoli2cd '$root'/usr/lpp/Tivoli2cd' 'symlink /TME '$root'/usr/lpp/Tivoli/lcf/preload/bin/os390/TME' 'symlink /server_root/dmq '$root'/usr/lpp/internet/server_root/dmq' 'symlink /ctg '$root'/usr/lpp/ctg' 'symlink /vaj35 '$root'/usr/lpp/vaj35' 'symlink /WebSphere35 '$root'/usr/lpp/WebSphere35' 'symlink $SYSNAME/was40 '$root'/usr/lpp/WebSphere40' say "Creating symbolic links for ims" 'symlink /imsjava '$root'/usr/lpp/imsjava' 'symlink /ims '$root'/usr/lpp/ims' 'symlink /imsjava/ims /ims' 'symlink /imsico '$root'/usr/lpp/imsico' say "Creating symbolic links for java hpj" 'symlink /hpjjava '$root'/usr/lpp/hpj' 'symlink /hpj/hpj /hpjjava' say "Creating symbolic links for wmqi" 'symlink /mqi210 '$root'/usr/lpp/wmqi' say "Creating symbolic links for eim" 'symlink /eim '$root'/usr/lpp/eim' say "Creating symbolic links for netview" 'symlink /netview '$root'/usr/lpp/netview' say "Creating symbolic links for wmqiprod" 'symlink /mqi210p '$root'/usr/lpp/wmqiprod' say "Creating symbolic links for local" 'symlink /local '$root'/usr/local' say "Creating symbolic links for wbimb" 'symlink /wbimb50/V5R0M1 '$root'/usr/lpp/wbimb' 'symlink /wbimb50p/V5R0M1 '$root'/usr/lpp/wbimbprod' say "Waiting for the terminfo database to be created" notdone=1 do while notdone 'wait wstat.' if retval=-1 then notdone=0 end say "Creating symbolic links for uucp, cron and dgw" 'symlink /etc/Permissions '$root'/usr/lib/uucp/Permissions' 'symlink /etc/Systems '$root'/usr/lib/uucp/Systems ' 'symlink /etc/Dialcodes '$root'/usr/lib/uucp/Dialcodes ' 'symlink /etc/Dialers '$root'/usr/lib/uucp/Dialers ' 'symlink /etc/Devices '$root'/usr/lib/uucp/Devices ' 'symlink /etc/config '$root'/usr/lib/uucp/config ' 'symlink /etc/at.allow '$root'/usr/lib/cron/at.allow ' 'symlink /etc/at.deny '$root'/usr/lib/cron/at.deny ' 'symlink /etc/cron.allow '$root'/usr/lib/cron/cron.allow ' 'symlink /etc/cron.deny '$root'/usr/lib/cron/cron.deny ' 'symlink /etc/queuedefs '$root'/usr/lib/cron/queuedefs ' sym='/dgw_pet/Counters/counter.cnt' file=$root||'/usr/lpp/internet/server_root/Counters/counter.cnt' 'symlink (sym) (file)' say "Change ownership for Firewall files" 'getgrnam FWGRP fwgrpid.' 'getpwnam FWADM fwuid.' 'chown '$root'/usr/lpp/fw/bin/admin_test 'fwuid.pw_uid fwgrpid.gr_gid 'chown '$root'/usr/lpp/fw/bin/cfgfilt 'fwuid.pw_uid fwgrpid.gr_gid 'chown '$root'/usr/lpp/fw/bin/fwadapter 'fwuid.pw_uid fwgrpid.gr_gid 'chown '$root'/usr/lpp/fw/bin/fwaudio 'fwuid.pw_uid fwgrpid.gr_gid 'chown '$root'/usr/lpp/fw/bin/fwcfgcmds 'fwuid.pw_uid fwgrpid.gr_gid 'chown '$root'/usr/lpp/fw/bin/fwcfgnat 'fwuid.pw_uid fwgrpid.gr_gid 'chown '$root'/usr/lpp/fw/bin/fwdaemon 'fwuid.pw_uid fwgrpid.gr_gid 'chown '$root'/usr/lpp/fw/bin/fwdns 'fwuid.pw_uid fwgrpid.gr_gid 'chown '$root'/usr/lpp/fw/bin/fwdsesskey 'fwuid.pw_uid fwgrpid.gr_gid 'chown '$root'/usr/lpp/fw/bin/fwfilter 'fwuid.pw_uid fwgrpid.gr_gid 'chown '$root'/usr/lpp/fw/bin/fwinsert 'fwuid.pw_uid fwgrpid.gr_gid 'chown '$root'/usr/lpp/fw/bin/fwjulian 'fwuid.pw_uid fwgrpid.gr_gid 'chown '$root'/usr/lpp/fw/bin/fwlog 'fwuid.pw_uid fwgrpid.gr_gid 'chown '$root'/usr/lpp/fw/bin/fwlogtxt 'fwuid.pw_uid fwgrpid.gr_gid 'chown '$root'/usr/lpp/fw/bin/fwmigrate 'fwuid.pw_uid fwgrpid.gr_gid 'chown '$root'/usr/lpp/fw/bin/fwnat 'fwuid.pw_uid fwgrpid.gr_gid 'chown '$root'/usr/lpp/fw/bin/fwstack 'fwuid.pw_uid fwgrpid.gr_gid 'chown '$root'/usr/lpp/fw/bin/fwtag 'fwuid.pw_uid fwgrpid.gr_gid 'chown '$root'/usr/lpp/fw/bin/fwtech.obj 'fwuid.pw_uid fwgrpid.gr_gid 'chown '$root'/usr/lpp/fw/bin/fwtech.zip 'fwuid.pw_uid fwgrpid.gr_gid 'chown '$root'/usr/lpp/fw/bin/fwtrace 'fwuid.pw_uid fwgrpid.gr_gid 'chown '$root'/usr/lpp/fw/bin/fwtunnl 'fwuid.pw_uid fwgrpid.gr_gid 'chown '$root'/usr/lpp/fw/bin/hand_key 'fwuid.pw_uid fwgrpid.gr_gid mask='00000004'x /* apf control bits */ value='00000004'x /* set apf control bits on */ say "Turn on setuid bit for setuid programs" 'chmod '$root'/bin/fomtlinc 4755' /* u+s */ 'chmod '$root'/bin/fomtlout 4755' /* u+s */ 'chmod '$root'/bin/login 4755' /* u+s */ 'chmod '$root'/bin/crontab 4755' /* u+s */ 'chmod '$root'/bin/rmail 4755' /* u+s */ 'chmod '$root'/bin/newgrp 4755' /* u+s */ 'chmod '$root'/bin/at 4755' /* u+s */ 'chmod '$root'/usr/sbin/ocsconfig 4755' /* u+s */ 'chmod '$root'/usr/sbin/tsmail 4755' /* u+s */ 'chmod '$root'/usr/lpp/fw/bin/fwdaemon 4755' /* u+s */ 'chmod '$root'/usr/lpp/fw/bin/fwmigrate 4755' /* u+s */ 'chmod '$root'/usr/lpp/fw/bin/fwstack 4755' /* u+s */ say "Before BPXISETS job, save Build etc and var and make dirs" address SYSCALL 'rename '$root'/etc '$root'/etcbuild' address SYSCALL 'rename '$root'/var '$root'/varbuild' call makedir $root'/etc' 777 call makedir $root'/var' 777 say "Running BPXISETS job to convert /etc to a symlink" address tso "oput 'D10.PETHFSN.JOBS(BPXISET2)' '/tmp/sets.sh'" 'chmod /tmp/sets.sh 777' address tso "oshell /tmp/sets.sh "$root say "Running usrspool job" address tso "oput 'D10.PETHFSN.JOBS(USRSPOOL)' '/tmp/usrspl.sh'" 'chmod /tmp/usrspl.sh 777' address tso "oshell /tmp/usrspl.sh "$root say "Running sendmail job" address tso "oput 'D10.PETHFSN.JOBS(SENDMAIL)' '/tmp/sendmail.sh'" 'chmod /tmp/sendmail.sh 777' address tso "oshell /tmp/sendmail.sh "$root say "Running usrmail job" address tso "oput 'D10.PETHFSN.JOBS(USRMAIL)' '/tmp/usrmail.sh'" 'chmod /tmp/usrmail.sh 777' address tso "oshell /tmp/usrmail.sh "$root /*********************************************************************/ /* say "Running infoprt job" */ /* address tso "oput 'D10.PETHFSN.JOBS(INFOP)' '/tmp/infop.sh'" */ /* 'chmod /tmp/infop.sh 777' */ /* address tso "oshell /tmp/infop.sh "$root */ /*********************************************************************/ say "Running dgw symlink job" address tso "oput 'D10.PETHFSN.JOBS(DGWSH)' '/tmp/dgw.sh'" 'chmod /tmp/dgw.sh 777' address tso "oshell /tmp/dgw.sh "$root say "Running webspher job" address tso "oput 'D10.PETHFSN.JOBS(WEBSPHER)' '/tmp/webspher.sh'" 'chmod /tmp/webspher.sh 777' address tso "oshell /tmp/webspher.sh "$root say "CUSTHFS: All done" exit /*********************************************************************/ /* Procedure makedir */ /* - Create a new dir */ /* - If the directory exists, call chmod to make sure the */ /* permission bits are correct */ /*********************************************************************/ makedir: procedure parse arg dir_name mode_bit . address SYSCALL 'mkdir' dir_name mode_bit If errno = EEXIST then do address SYSCALL 'chmod' dir_name mode_bit say 'chmod' dir_name 'completed with' mode_bit end else if errno = 0 then do address SYSCALL 'chmod' dir_name mode_bit say 'chmod' dir_name 'completed with' mode_bit end else say 'Directory' dir_name 'not created, error codes' errno errnojr return /*********************************************************************/ /* Procedure rdir */ /*********************************************************************/ rdir: procedure expose types calltp call syscalls on parse arg path d.0=0 address syscall 'readdir (path) d.' do i=1 to d.0 dpath=path'/'d.i address syscall 'lstat (dpath)' st. if st.st_type=s_isdir & d.i<>'.' & d.i<>'..' then call rdir dpath if d.i<>'.' & d.i<>'..' then call processname dpath end return /*********************************************************************/ /* Procedure processname */ /*********************************************************************/ processname: select when st.st_type=s_isdir then rmdir (dpath) when st.st_type=s_ischr then say 'Chr ' dpath when st.st_type=s_isfifo then say 'FIFO' dpath when st.st_type=s_isreg then unlink (dpath) when st.st_type=s_issym then unlink (dpath) otherwise say '????' dpath end return