Porting UNIX Applications to Openedition for VM/ESA
Total Page:16
File Type:pdf, Size:1020Kb
Porting UNIX Applications to OpenEdition for VM/ESA Erich Amrehn, Neale Ferguson, Jean-Francois Jiguet International Technical Support Organization http://www.redbooks.ibm.com SG24-5458-00 International Technical Support Organization SG24-5458-00 Porting UNIX Applications to OpenEdition for VM/ESA August 1999 Take Note! Before using this information and the product it supports, be sure to read the general information in Appendix M, “Special Notices” on page 337. First Edition (August 1999) This edition applies to Virtual Machine/Enterprise Systems Architecture (VM/ESA) Version 2, Release 3.0, program number 5654-030 for use with OpenEdition for VM/ESA. Comments may be addressed to: IBM Corporation, International Technical Support Organization Dept. HYJ Mail Station P099 522 South Road Poughkeepsie, NY 12601-5400 When you send information to IBM, you grant IBM a non-exclusive right to use or distribute the information in any way it believes appropriate without incurring any obligation to you. © Copyright International Business Machines Corporation 1999. All rights reserved. Note to U.S Government Users - Documentation related to restricted rights - Use, duplication or disclosure is subject to restrictions set forth in GSA ADP Schedule Contract with IBM Corp. Contents Figures ......................................................xi Tables .......................................................xv Preface .....................................................xvii The team that wrote this redbook ......................................xvii Commentswelcome...............................................xviii Chapter 1. Introduction to porting .................................1 1.1Leveragingyourinvestment....................................1 1.2Thebottomline..............................................3 1.3Theresources...............................................3 1.3.1Softwarerequired........................................3 1.3.2 Skills needed............................................4 1.3.3Ourworkspace..........................................4 1.3.4Theapplicationsweported.................................4 1.3.5Otherresources.........................................4 1.4 Process management . ........................................5 1.4.1Processes..............................................5 1.4.2 Threads. .............................................8 1.4.3Interprocesscommunication(IPC)...........................8 1.4.4 Signals . ............................................10 Chapter 2. Setting up the VM environment .........................13 2.1OurVMsystem.............................................13 2.2AddingourfirstuserstotheCPdirectory.........................14 2.2.1BFSSERVECPdirectoryentry.............................14 2.2.2PORTINGCPdirectoryentry...............................15 2.2.3UIDandGIDexplained...................................15 2.3CreatingtheBFSserver......................................16 2.3.1FormattingBFSSERVE191minidisk.........................16 2.3.2CreatingthePROFILEEXEC..............................17 2.3.3DefiningBFSTESTDMSPARMS............................17 2.3.4DefiningBFSPOOLDEF..................................17 2.3.5BuildingtheBFSTESTserver..............................18 2.3.6 Enrolling users to the BFSTEST filepool ......................18 2.3.7 Updating execs to load the objects ..........................18 2.3.8 Loading the BFS . .......................................19 2.3.9 Creating a second playground. ............................19 2.4 Establishing the OpenEdition for VM/ESA environment...............19 2.4.1CreatePROFILEEXECforthePORTINGuserID...............19 2.4.2 3270 considerations .....................................20 2.4.3StartingtheSHELL......................................21 2.4.4Creatingourfirsttool.....................................23 2.4.5Customizing/etc/profile...................................23 2.4.6 Some useful Shell commands and utilities.....................25 Chapter 3. Porting application guide ..............................31 3.1S/390andVM/ESAportingissues...............................31 3.1.1ASCIIversusEBCDIC....................................31 3.1.2Forkingandspawning....................................35 © Copyright IBM Corp. 1999 iii 3.1.3Sampleconversions..................................... 36 3.1.4Othergotchasandhints.................................. 40 3.2 XPG4 supplementary APIs ................................... 48 3.2.1XPG4installation....................................... 49 3.2.2 Using XPG4 utility commands ............................. 50 Chapter 4. Porting the essential tools (GNUgzip, GNUmake) .......... 51 4.1WhatisGNU.............................................. 51 4.2PortingGNUgzip........................................... 51 4.2.1Whatisgzip........................................... 52 4.2.2 Loading gzip sources....................................52 4.3PortingGNUmake......................................... 57 4.3.1 About GNU make. .................................... 57 4.3.2 Capabilities of make .................................... 58 4.3.3makeRulesandTargets.................................58 4.3.4 Advantages of GNU make . .............................. 58 4.3.5GettingGNUmake...................................... 59 4.3.6 Loading GNU make in BFS . .............................. 59 4.3.7 Running configure . ....................................60 4.3.8 Compiling GNU make ................................... 60 4.3.9Checkingusageoffork().................................73 4.3.10RebuildingGNUmake.................................. 79 4.3.11Usingmake.......................................... 80 4.3.12 Debugging make . ....................................81 4.3.13TestingGNUmake.................................... 85 4.4Installingmake............................................85 Chapter 5. Infrastructure packages .............................. 87 5.1 Standard PROFILE EXEC ....................................87 5.2SYSLOGD................................................ 88 5.2.1SYSLOGDCPdirectoryentry............................. 88 5.2.2 SYSLOGD BFS requirements ............................. 88 5.2.3SYSLOGDinstallationandconfiguration.....................89 5.3 INETD - the Internet super daemon ............................. 91 5.3.1INETDCPdirectoryentry................................ 93 5.3.2 INETD BFS requirements . .............................. 93 5.3.3INETDinstallationandconfiguration........................ 93 5.4 DAYTIMED - daytime and time daemon. ......................... 95 5.4.1 Daytime daemon . .................................... 95 5.4.2 Time daemon. ......................................... 96 5.4.3DAYTIMEDinstallation.................................. 96 5.5CROND.................................................. 97 5.5.1CRONDCPdirectoryentry............................... 99 5.5.2 CROND BFS requirements . .............................. 99 5.5.3CRONDinstallationandconfiguration....................... 99 5.6REGINA(REXXforUNIX)................................... 100 5.6.1 Regina prerequisite tools . ............................. 100 5.6.2Reginainstallation..................................... 101 5.6.3UsingRegina......................................... 102 5.7RCS................................................... 103 5.7.1FunctionsofRSCS.................................... 104 5.7.2RCSinstallation....................................... 104 5.7.3GNUDiffinstallation................................... 105 iv Porting UNIX Applications to OpenEdition for VM/ESA 5.7.4GettingstartedwithRCS.................................105 5.7.5Automaticidentification..................................107 5.8Patch...................................................108 5.8.1Patchinstallation.......................................108 5.8.2Usingpatch...........................................108 Chapter 6. Configuring and running business applications...........111 6.1Samba..................................................111 6.1.1WhatisSMB..........................................111 6.1.2WhyuseSMB.........................................111 6.1.3WhatSambacando....................................111 6.1.4 Samba components ....................................112 6.1.5SambaCPdirectoryentry................................113 6.1.6 Samba BFS requirements ................................113 6.1.7Sambainstallationandconfiguration........................113 6.1.8UsingSamba.........................................115 6.2LDAP...................................................121 6.2.1Whatisadirectoryservice...............................121 6.2.2WhatisLDAP.........................................121 6.2.3 The OpenLDAP distribution...............................123 6.2.4LDAPCPdirectoryentry.................................123 6.2.5LDAPBFSrequirements.................................123 6.2.6 Install GDBM prerequisite ................................123 6.2.7LDAPinstallation.......................................124 6.2.8LDAPconfiguration.....................................124 6.2.9 Building the database . ................................125 6.2.10StartingtheLDAPserver................................128 6.2.11ConfiguringanLDAPclient..............................129 6.2.12UsingNetscapetosearchdirectory........................134 6.3Apache..................................................136 6.3.1ApacheCPdirectoryentry................................136 6.3.2 Apache BFS requirements ...............................137 6.3.3Apacheinstallationandconfiguration.......................137