Tải bản đầy đủ - 0 (trang)
Chapter 2.  Installing and Configuring Mac OS X Server

Chapter 2.  Installing and Configuring Mac OS X Server

Tải bản đầy đủ - 0trang

2.1.MacOSXServerInstallationArchitecture

Inordertobestunderstandinstallationoptions,itisimportant

tohaveathoroughknowledgeoftheinstallationarchitecture.

Howistheinstallationenvironmentprepared?Whathappens

duringsystemstartup,andwhatservicesareavailabletothe

OS?Applehasactuallydevelopedaverymodularbootprocess,

flexibleenoughthatthesamesequenceisusedregardlessof

whetherthemachineisbootingfromCD,offofthenetworkor

fromthelocalharddisk.We'llbelookingspecificallyatanOS

installinthiscase,butsomeofthismaterialisgeneralenough

toapplytoothertypesofbootingaswell.



2.1.1.PowerOn

Whenthemachineisbooted,itisinitiallycontrolledbyitsbuiltinbootROM,consistingofaminimalPowerOnSelfTest(POST)

andApple'sOpenFirmwareenvironment(OF).Unlessotherwise

configured,OF,afterbuildingadevicetree,executesBootX,the

system'sbooter.Inmostcases,BootXisexecutedfromthe

devicespecifiedinOF'sboot-devicevariable,whichlooks

somethinglikeExample2-1whenbootingfromaninternalIDE

drive:.



Example2-1.HereI'veusedthenvram

command's-pflagtoprintthecontentsofOpen

Firmware.Thisoutputisfilteredusingthegrep

commandsothatonlytheboot-devicesettingis

shown.

Big15:~mab9718$nvram-p|grepboot-device

boot-devicepci2/ata-6@D/@0:9,\\:tbxi



However,wheninstallinganOS,it'scommontochoosea

startupvolumemanually.Thereareseveralwaystoaccomplish

this.ByfarthemostcommonistoholddowntheCkeyat

startup,overridingtheboot-devicevariableandbootingfrom

CDs.OtheroptionsincludeholdingdowntheNkey(bootoffthe

network)andOption,whichprovidesalistoflocalvolumesto

bootfrom.[*]It'sunlikelyinmanycasesthatyou'llhaveeasy

keyboardormonitoraccesstoaserverinarack.Withthisin

mind,Applehasbuiltacompletelyheadlessbootmenuintothe

Xserve.Findoutmoreaboutithere:

http://docs.info.apple.com/article.html?artnum=106482.

[*]IfaNetBootserverisavailable,aNetBooticonappearsonscreenwithlocalvolumes.However,youwon'tbe

abletochooseaspecificbootimageifmorethanoneisavailable.



Ofcourse,theboot-devicesettingmaybesetmanuallyusingeitherthe

GraphicalInterface(specifically,theStartupDiskpaneoftheSystem

Preferencesapplication)ornumberofcommandsamongthemblessand

systemsetup;consulttheirmanpagesfordetails.



Fromtherestartupproceedsnormally,asitwouldwhenbooting

fromaharddrive,whichisexplainedverywellbyAppleat

http://developer.apple.com/documentation/MacOSX/Conceptual/SystemOv

Thefirstdifferencebetweenanormalbootandinstallation

comesin/etc/rc.boot,thescriptthatbringsthemachineup

enoughtobootintosingle-usermode(seeExample2-1).

Specifically,if/System/Installationand/private/etc/rc.cdrom

bothexist,thesystemassumesitisbootingfromCD.[ ]

[ ]Incidentally,ifyou'vebuiltacustombootCD,andyou'rebootingfromCDforsomereasonotherthanan

install,youmightneedtomodifythisscript,sinceitassumesaCDbootisrelatedtotheinstallationarchitecture.



Example2-2.Thescriptingwithin/etc/rc.boot

thatdetermineswhetheramachineisbeing

bootedfromCD.



if[-d/System/Installation]&&[-f/private/etc/rc.cdrom];

ConsoleMessage"Rootdeviceismountedread-only"

ConsoleMessage"Filesystemchecksskipped"

iscdrom=1

else

iscdrom=0

fi



Thisassumptionisusedonlytodeterminewhetherfsckshould

run.Therealworkcomeswiththe/etc/rcand/etc/rc.cdrom

commands.Theformer(basedonlogicsimilar,butnotidentical

to,/etc/rc.boot)executesthelatterifthesystemisbootedfrom

aninstallCD.Therc.cdromscriptdoesseveralthings:

SetsthedatetoApril1,1976ifthesystemclockisset

earlier.

Changesthemaximumvnodes,orfilestructures,thatthe

kernelmaycache.Ineffect,thischangestheamountof

RAMthatmaybeusedasafilesystemcache.

Disablesprebinding(aperformance-increasingtechnology

thatrequiresaread-writefilesystem.

Ifoneexists,runsapreheatscriptthatspeedsCDbooting.

Loadskextd,thedaemonresponsibleformanagingthe

loadingandunloadingofkernelextensions.kextdisrun

withtheJoption,whichspeedsthebootprocessbyloading



nativedrivers(NDRVs),whichareminimalandgeneric.

Usestheifconfigcommandtosetupthelocalinterface

(configdhasn'tyetstarted,soitisOKtouseifconfig).

Mounts/.volfs,aspecialfilesystemusedtoenableCarbon

applicationstoaccessfilesbytheirfileID,whichisanHFSspecificconvention.

Mountsthesynthfs,afilesystemusedsolelytocreate

mountpointsforothervolumes(usuallywhentherootis

read-only)in/Volumes.Thisisdonesothatvolumes

discoveredbydiskarbitrationcanbemountedwhenbooted

fromCD.

Registersseveralprocesseswithmach_initusingthe

register_mach_bootstrap_serverscommand.mach_init,

amongotherthings,iscapableofstartingcertainservices

ondemand.

Startsadaemonspecificallyresponsibleforlogginginstaller

processes(/System/Installation/CDIS/instlogd).

ChecksfortheexistenceoftheGUICrashCatcher.

CreatesaRAMdiskforsyslog.

Logsthebootdateandtime.

CreatesaRAMdiskforandthenstartscrashreporter.

Checksfor/etc/rc.cdrom.local,andrunsitifitexists.Ifyou

havelocalizedscriptsthatneedtoberun,youcanadd

themtothisfileonanimageofthebootCDandre-burnit.

Thisfiledoesnotexistonadefaultinstall.



Checksfor/etc/rc.cdrom.preWS,andrunsitifitexists.This

fileisforscriptsthatshouldrunbeforeWindowServerruns.

Thisfiledoesnotexistonadefaultinstall.

StartsAppleTypeServices(ATSServer),whichhelpsthe

systemdisplayfonts.ATSServerrequiresWindowServer,

whichisstartedondemandbymach_init.

StartsthePasteBoardserver(pbs),usedtosupportendusercut/copy/pasteoperations.

Checksfor/etc/rc.cdrom.postWS,andrunsitifitexists.

Thisfileisforscriptsthatshouldberunafterthe

WindowServerisrun.ThisscriptexistsontheMacOSX

ServerinstallCD.Infact,manyoftheserver-specific

startupoptionslivethere.

rc.cdrom.postWSrunswhilerc.cdromwaitsinthe

background.rc.cdrom.postWSdoesthefollowing:

CreatesaRAMdiskforconfigd'sdatastore,mountsitat

/private/var/run,andrunsconfigd.

Mounts/tmpasaRAMdisk.

CreatesaRAMdisktosupportNetInfo(/var/db/netinfo)

andstartsNetInfo.

Runs/sbin/SystemStarter,whichisresponsibleforstarting

mostsystemservices.SystemStarterreads/etc/hostconfig,

wheretheconfigurationforseveralstartupitemsare

stored.SystemStarterhasagreatmanpage,sowewon'tgo

intoadetailedanalysisofitsarchitecture.

Wewill,however,discussstartupitemswithaspecific

bearingoninstallation:



Network

Bringsupallnonloopbackinterfaceswiththeipconfig[*]

command.Themachineattemptstogetanaddressvia

DHCPoneveryinterface.Ifthisfails,themachinefallsback

toalink-local(169.254)address,allowingittobelocated

andconfiguredremotelyonthelocalsubnet.Alsoenables

IPv6andIPforwarding(bothusingsysctlcommand)if

specifiedin/etc/hostconfig.

[*]ipconfigisacommand-lineutilityusedtoaccesstheSystemConfigusrationdatabase.

Specifically,thewaitallflagbringsupeveryconfiguredinterface.



HeadlessStartup

HeadlessStartupshouldprobablybecalledHeadlessInstall,

becauseitdoesalmostnothingtosupportnormal,

noninstallationheadlessbootingtheexceptionbeingntpd

(thenetworktimeserver),whichisstartediftheTIMESERV

enTRyissetto-YES-in/etc/hostconfig).Itadditionally

checksforNetBoot,HardDriveBoot,orCDBoot,andsets

optionsappropriateforeach.ForCDandNetBoot,this

includessettingatemporaryrootpassword,settingupSSH

key-pairs,andstartingsa_responder(in

/System/Library/ServerSetup),theprocessresponsiblefor

advertisingtheserverviamulticast.

Theharddrivebootadditionallyassumesthattheserver

hasbeeninstalledandisreadyforconfiguration.This

requiresanumberofotheroperations,includinggathering

certaindata,settingpowermanageroptionswiththepmset

command,andsettingthesrvvariableinOpenFirmwareto

1.Naturally,iftheserverisalreadyconfigured(basedon

thepresenceoftheemptyfile/var/db/.AppleSetupDone),

nothingisdonetosetitupforinstallorconfiguration.



HeadlessStartupisalsoresponsibleformanagingMacOS

X'sautomaticconfigurationprocess,discussedlaterinthis

chapter.



HeadlessStartupisreallytheheartofMacOS

XServer'sremoteinstallationand

configurationarchitecture.Itworksclosely

withanumberofutilitiesin

/System/Library/ServerSetup.



SerialTerminalSupport

QuitepossiblythefineststartupitemauthoredbyAppleto

date,thisscriptconsistsof379lines,168ofwhichare

comments.Unfortunately,though,ratherthanbeingsetin

/etc/hostconfig,itsvariablesaresetinthescriptitself.

SerialTerminalSupport,amongotherthings(asthename

implies)managestheOS'sabilitytousetheserialporton

Applehardwareplatforms.Ithasthreevariables:

ENABLE_SERIAL_TERMINAL=$TRUE

ENABLE_AUTOMOUNT_DISKS_WITHOUT_USER_LOGIN=$TRUE

ENABLE_SERIAL_SYSLOG=$FALSE



Respectively,whensettheyenableserialsupport,bychanging:



tty.serial"/usr/libexec/gettyserial.9600"vt100offsec



to:



tty.serial"/usr/libexec/gettyserial.9600"vt100onsecu



in/etc/ttys,configureexternaldiskstomountwhennooneis

loggedintotheconsolebychangingthe

AutomountDisksWithoutUserLoginkeyfromfalsetotruein

/Library/Preferences/diskarbitrationd.xmlandturnonsyslog

outputtotheserialport[*]byuncommentingthefollowingitem

in/etc/syslog.conf:

[*]Thisisdonesothatloggingissenttotheserialport,whichiscommonintheUnixworld.



#*.err;kern.*;auth.notice;authpriv,remoteauth.none;mail.crit

/dev/tty.serial



ENABLE_SERIAL_SYSLOGistheonlyoptionthatissettoFALSEonan



out-of-boxinstallation.TheSerialTerminalSupportstartupitem

worksonlyonAppleServerhardware;itchecksforthe

RackMac1tagintheoutputofthesysctlhw.modelcommand.



AtsomepointduringthePanthertimeline,the

ENABLE_AUTOMOUNT_DISKS_WITHOUT_USER_LOGINoptionwasremovedfromthe

Serial-TerminalSupportstartupitem,becauseitisnowadefault

behavioronMacOSXServer.



AfterSystemStarterhascompleteditstasks,rc.cdrom.postWS

completes,handingcontrolbackovertorc.cdrom,whichstarts

thegraphicalinstaller.Inadditiontowaitingforuserinput,the

serverhasobtainedanIPaddress,eitherfromaDHCPserver

orself-assigned,andSSH(startedbythexinetdprocess)is

enabled,allowingforremoteinstallation.Additionally,the



sa_responderprocessisadvertisingthatthemachineisbooted

fromCDandreadyforinstallation.

Inanoninstallationstartup,loginwindowisstarted.However,if

loginwindowdoesn'tdetect/var/db/.AppleSetupDoneordoes

detect/var/db/.AppleMultiCDInstall,itstartstheServer

AssistantortheInstaller,respectively.



2.2.GraphicalInstallationandConfiguration

Thesimplest,mostcommonformofinstallationisalocal,

graphicalinstall.We'llstartthereinordertogetabasic

understandingoftheinstallprocessandApple'sgoalsforit.



2.2.1.LocalInstallation

AlocalinstallationbootingfromCD,sittinginfrontoftheserver

consoleisprettystraightforward.Bythispointintheinstallation

processyoushouldhavebothasaneplanfordeploymentanda

goodunderstandingoftheCDbootenvironment.Whenbooted

fromthePantherServerCD,youhaveeasyaccesstoTerminal,

DiskUtility,aResetPasswordutility(toresetthepasswordfor

usersonanalready-installedsystem)andautilitytochange

thecurrentstartupdisk,allundertheInstallermenu(the

JaguarServerinstallationprocesshasnoStartupDiskutility).

Theinitialinstallationscreen,listedinFigure2-1,allowsforthe

choiceofaninstallationlanguage.

YourfirststopwilltypicallybeDiskUtility.InPanther,Disk

Copy'sfunctionalityhasbeenrolledintoanew,single-window

diskutilityinterface,seeninFigure2-2.Itsfunctionalityisvery

contextual,withtherightpaneoftheapplicationchangingto

reflectthefunctionssupportedontheselectedobject(disk,

partition,orimage).

Entiredisksmayberepaired,erased,partitioned,addedtoa

RAIDorrestored(thelastisanewoptioninPantherthatwe'll

discusslaterinthischapter).Itisan



Figure2-1.Theinitialinstallationscreenwhen

bootedfromtheMacOSXServerinstalldisk.



Figure2-2.Panther'sDiskUtilitywhenbooted

fromtheMacOSXServerinstallCD.



Tài liệu bạn tìm kiếm đã sẵn sàng tải về

Chapter 2.  Installing and Configuring Mac OS X Server

Tải bản đầy đủ ngay(0 tr)

×