SystemAdministrationGuide:Basic Administration PartNo:821–1451–01 November2010 Copyright©1998,2010,Oracleand/oritsaffiliates.Allrightsreserved. Thissoftwareandrelateddocumentationareprovidedunderalicenseagreementcontainingrestrictionsonuseanddisclosureandareprotectedbyintellectual propertylaws.Exceptasexpresslypermittedinyourlicenseagreementorallowedbylaw,youmaynotuse,copy,reproduce,translate,broadcast,modify,license, transmit,distribute,exhibit,perform,publish,ordisplayanypart,inanyform,orbyanymeans.Reverseengineering,disassembly,ordecompilationofthissoftware, unlessrequiredbylawforinteroperability,isprohibited. Theinformationcontainedhereinissubjecttochangewithoutnoticeandisnotwarrantedtobeerror-free.Ifyoufindanyerrors,pleasereportthemtousinwriting. IfthisissoftwareorrelatedsoftwaredocumentationthatisdeliveredtotheU.S.GovernmentoranyonelicensingitonbehalfoftheU.S.Government,thefollowing noticeisapplicable: U.S.GOVERNMENTRIGHTSPrograms,software,databases,andrelateddocumentationandtechnicaldatadeliveredtoU.S.Governmentcustomersare “commercialcomputersoftware”or“commercialtechnicaldata”pursuanttotheapplicableFederalAcquisitionRegulationandagency-specificsupplemental regulations.Assuch,theuse,duplication,disclosure,modification,andadaptationshallbesubjecttotherestrictionsandlicensetermssetforthintheapplicable Governmentcontract,and,totheextentapplicablebythetermsoftheGovernmentcontract,theadditionalrightssetforthinFAR52.227-19,Commercial ComputerSoftwareLicense(December2007).OracleAmerica,Inc.,500OracleParkway,RedwoodCity,CA94065. Thissoftwareorhardwareisdevelopedforgeneraluseinavarietyofinformationmanagementapplications.Itisnotdevelopedorintendedforuseinanyinherently dangerousapplications,includingapplicationswhichmaycreateariskofpersonalinjury.Ifyouusethissoftwareorhardwareindangerousapplications,thenyou shallberesponsibletotakeallappropriatefail-safe,backup,redundancy,andothermeasurestoensureitssafeuse.OracleCorporationanditsaffiliatesdisclaimany liabilityforanydamagescausedbyuseofthissoftwareorhardwareindangerousapplications. OracleandJavaareregisteredtrademarksofOracleand/oritsaffiliates.Othernamesmaybetrademarksoftheirrespectiveowners. AMD,Opteron,theAMDlogo,andtheAMDOpteronlogoaretrademarksorregisteredtrademarksofAdvancedMicroDevices.IntelandIntelXeonare trademarksorregisteredtrademarksofIntelCorporation.AllSPARCtrademarksareusedunderlicenseandaretrademarksorregisteredtrademarksofSPARC International,Inc.UNIXisaregisteredtrademarklicensedthroughX/OpenCompany,Ltd. Thissoftwareorhardwareanddocumentationmayprovideaccesstoorinformationoncontent,products,andservicesfromthirdparties.OracleCorporationand itsaffiliatesarenotresponsibleforandexpresslydisclaimallwarrantiesofanykindwithrespecttothird-partycontent,products,andservices.OracleCorporation anditsaffiliateswillnotberesponsibleforanyloss,costs,ordamagesincurredduetoyouraccesstooruseofthird-partycontent,products,orservices. Copyright©1998,2010,Oracleet/ousesaffiliés.Tousdroitsréservés. Celogicieletladocumentationquil’accompagnesontprotégésparlesloissurlapropriétéintellectuelle.Ilssontconcédéssouslicenceetsoumisàdesrestrictions d’utilisationetdedivulgation.Saufdispositiondevotrecontratdelicenceoudelaloi,vousnepouvezpascopier,reproduire,traduire,diffuser,modifier,breveter, transmettre,distribuer,exposer,exécuter,publierouafficherlelogiciel,mêmepartiellement,sousquelqueformeetparquelqueprocédéquecesoit.Parailleurs,ilest interditdeprocéderàtouteingénierieinversedulogiciel,deledésassembleroudeledécompiler,exceptéàdesfinsd’interopérabilitéavecdeslogicielstiersoutelque prescritparlaloi. Lesinformationsfourniesdanscedocumentsontsusceptiblesdemodificationsanspréavis.Parailleurs,OracleCorporationnegarantitpasqu’ellessoientexemptes d’erreursetvousinvite,lecaséchéant,àluienfairepartparécrit. Sicelogiciel,ouladocumentationquil’accompagne,estconcédésouslicenceauGouvernementdesEtats-Unis,ouàtouteentitéquidélivrelalicencedecelogiciel oul’utilisepourlecompteduGouvernementdesEtats-Unis,lanoticesuivantes’applique: U.S.GOVERNMENTRIGHTS.Programs,software,databases,andrelateddocumentationandtechnicaldatadeliveredtoU.S.Governmentcustomersare "commercialcomputersoftware"or"commercialtechnicaldata"pursuanttotheapplicableFederalAcquisitionRegulationandagency-specificsupplemental regulations.Assuch,theuse,duplication,disclosure,modification,andadaptationshallbesubjecttotherestrictionsandlicensetermssetforthintheapplicable Governmentcontract,and,totheextentapplicablebythetermsoftheGovernmentcontract,theadditionalrightssetforthinFAR52.227-19,Commercial ComputerSoftwareLicense(December2007).OracleAmerica,Inc.,500OracleParkway,RedwoodCity,CA94065. Celogicieloumatérielaétédéveloppépourunusagegénéraldanslecadred’applicationsdegestiondesinformations.Celogicieloumatérieln’estpasconçunin’est destinéàêtreutilisédansdesapplicationsàrisque,notammentdansdesapplicationspouvantcauserdesdommagescorporels.Sivousutilisezcelogicieloumatériel danslecadred’applicationsdangereuses,ilestdevotreresponsabilitédeprendretouteslesmesuresdesecours,desauvegarde,deredondanceetautresmesures nécessairesàsonutilisationdansdesconditionsoptimalesdesécurité.OracleCorporationetsesaffiliésdéclinenttouteresponsabilitéquantauxdommagescausés parl’utilisationdecelogicieloumatérielpourcetyped’applications. OracleetJavasontdesmarquesdéposéesd’OracleCorporationet/oudesesaffiliés.Toutautrenommentionnépeutcorrespondreàdesmarquesappartenantà d’autrespropriétairesqu’Oracle. AMD,Opteron,lelogoAMDetlelogoAMDOpteronsontdesmarquesoudesmarquesdéposéesd’AdvancedMicroDevices.InteletIntelXeonsontdesmarquesou desmarquesdéposéesd’IntelCorporation.TouteslesmarquesSPARCsontutiliséessouslicenceetsontdesmarquesoudesmarquesdéposéesdeSPARC International,Inc.UNIXestunemarquedéposéeconcédésouslicenseparX/OpenCompany,Ltd. 110425@25097 Contents Preface...................................................................................................................................................11 1 ManagingUserAccountsandGroups(Overview) .........................................................................17 WhatAreUserAccountsandGroups?.............................................................................................17 UserAccountComponents ........................................................................................................17 GuidelinesforAssigningUserNames,UserIDs,andGroupIDs..........................................24 WhereUserAccountandGroupInformationIsStored ................................................................24 FieldsinthepasswdFile ..............................................................................................................25 DefaultpasswdFile ......................................................................................................................25 FieldsintheshadowFile ..............................................................................................................27 FieldsinthegroupFile ................................................................................................................28 DefaultgroupFile ........................................................................................................................28 ToolsforUserAccountandGroupAccountManagement ...........................................................29 CustomizingaUser'sWorkEnvironment .......................................................................................30 UsingSiteInitializationFiles ......................................................................................................31 AvoidingLocalSystemReferences ............................................................................................31 ShellFeatures................................................................................................................................31 Bashandksh93ShellHistory......................................................................................................32 Bashandksh93ShellEnvironmentVariables..........................................................................33 CustomizingtheBashShell ........................................................................................................35 AbouttheMANPATHEnvironmentVariable...............................................................................36 ThePATHVariable ........................................................................................................................36 LocaleVariables ...........................................................................................................................37 DefaultFilePermissions(umask) ...............................................................................................38 CustomizingaUserInitializationFile.......................................................................................39 3 Contents 2 ManagingUserAccountsandGroups(Tasks).................................................................................41 SettingUpandAdministeringUserAccounts(TaskMap) ...........................................................41 SettingUpUserAccounts ..................................................................................................................42 GatheringUserInformation.......................................................................................................42 ▼HowtoCustomizeUserInitializationFiles ..............................................................................43 ▼HowtoSetAccountDefaults......................................................................................................44 ▼HowtoAddaUser.......................................................................................................................45 ▼HowtoDeleteaUser ...................................................................................................................45 ▼HowtoAddaRole .......................................................................................................................46 ▼HowtoAddaGroup....................................................................................................................47 ▼HowtoShareaUser'sHomeDirectory.....................................................................................48 ManuallyMountingaUser'sHomeDirectory. ........................................................................48 3 IntroductiontoShuttingDownandBootingaSystem ................................................................49 What'sNewinShuttingDownandBootingaSystem ....................................................................49 SupportforFastRebootontheSPARCPlatform.....................................................................50 AutomaticBootArchiveRecovery ............................................................................................50 GNOMERestartDialogSupportforFastReboot....................................................................51 SupportforFastRebootonthex86Platform ...........................................................................51 iSCSIBoot.....................................................................................................................................51 WheretoFindShutDownandBootTasks ......................................................................................52 ShutDownandBootTerminology ...................................................................................................53 GuidelinesforShuttingDownaSystem...........................................................................................53 GuidelinesforBootingaSystem........................................................................................................54 WhentoShutDownaSystem............................................................................................................55 WhentoBootaSystem.......................................................................................................................56 4 ShuttingDownandBootingaSystem(Overview) ........................................................................57 FundamentalsoftheOracleSolarisBootDesign ............................................................................57 OverviewoftheSPARCBootArchitecture......................................................................................59 SupportforBootingMultipleKernels.......................................................................................60 ImplementationoftheBootArchivesonSPARC ....................................................................60 x86:OverviewoftheGRUBBootloader...........................................................................................61 GRUBBasedBooting ..................................................................................................................61 x86:SupportforthefindrootCommand................................................................................62 4 SystemAdministrationGuide:BasicAdministration • November2010 Contents x86:SupportforFastReboot..............................................................................................................62 x86:FastRebootFeatureEnhancements...................................................................................62 quiesceFunction ........................................................................................................................63 uadminFunction...........................................................................................................................64 BootingFromanOracleSolarisZFSRootFileSystem...................................................................64 5 ShuttingDownaSystem(Tasks).......................................................................................................67 ShuttingDowntheSystem(TaskMap)............................................................................................67 ShuttingDowntheSystem .................................................................................................................68 SystemShutdownCommands ...................................................................................................68 UserNotificationofSystemDownTime ..................................................................................69 ▼HowtoDetermineWhoIsLoggedintoaSystem ...................................................................70 ▼HowtoShutDownaServer........................................................................................................70 ▼HowtoShutDownaStand-AloneSystem ...............................................................................73 TurningOffPowertoAllDevices .....................................................................................................75 ▼HowtoTurnOffPowertoAllDevices......................................................................................75 6 ModifyingOracleSolarisBootBehavior(Tasks)............................................................................77 ModifyingBootBehavioronSPARCBasedSystems(TaskMap).................................................77 ModifyingBootBehavioronSPARCBasedSystems......................................................................78 SPARC:UsingtheBootPROM ..................................................................................................78 ▼SPARC:HowtoFindthePROMRevisionNumberforaSystem...........................................79 ▼SPARC:HowtoIdentifyDevicesonaSystem..........................................................................79 ▼SPARC:HowtoDeterminetheDefaultBootDevice ..............................................................81 ▼SPARC:HowtoChangetheDefaultBootDevicebyUsingtheBootPROM.......................81 ▼SPARC:HowtoChangetheDefaultBootDevicebyUsingtheeepromCommand............83 SPARC:ResettingtheSystem .....................................................................................................83 ▼SPARC:HowtoChangetheDefaultKernelbyUsingtheBootPROM ................................83 ▼SPARC:HowtoChangetheDefaultKernelbyUsingtheeepromCommand .....................84 ModifyingBootBehavioronx86BasedSystems(TaskMap) .......................................................85 ModifyingBootBehavioronx86BasedSystems ............................................................................85 ▼x86:HowtoModifyBootBehaviorbyUsingtheeepromCommand....................................86 x86:ModifyingBootBehaviorbyEditingtheGRUBMenuatBootTime ...........................87 BootArgumentsThatCanBeSpecifiedbyEditingtheGRUBMenuatBootTime ...........87 ▼x86:HowtoModifyBootBehaviorbyEditingtheGRUBMenuatBootTime ...................88 5 Contents x86:ModifyingBootBehaviorbyEditingthemenu.lstFile .................................................89 ▼x86:HowtoModifyBootBehaviorbyEditingthemenu.lstFile .........................................90 x86:LocatingtheActiveGRUBmenu.lstFile.........................................................................92 x86:ImplementationofthefindrootCommand ...................................................................92 ▼x86:HowtoAddGRUBMenuEntriesThatUsethefindrootCommand .........................93 7 BootinganOracleSolarisSystem(Tasks)........................................................................................95 BootingaSPARCBasedSystem(TaskMap) ...................................................................................95 BootingaSPARCBasedSystem.........................................................................................................96 ▼SPARC:HowtoBootaSystemtoRunLevel3(MultiuserLevel)...........................................96 ▼SPARC:HowtoBootaSystemtoRunLevelS(Single-UserLevel) .......................................97 ▼SPARC:HowtoBootaSystemInteractively ............................................................................98 ▼SPARC:HowtoBootaKernelOtherThantheDefaultKernel............................................100 SPARC:BootingFromaSpecifiedZFSRootFileSystem .............................................................101 ▼SPARC:HowtoListAvailableBootableDatasetsWithinaZFSRootPool ........................102 ▼SPARC:HowtoBootFromaSpecifiedZFSRootFileSystem..............................................103 BootingaSPARCBasedSystemFromtheNetwork......................................................................105 ▼SPARC:HowtoBootaSystemFromtheNetwork ................................................................105 Bootinganx86BasedSystem(TaskMap)......................................................................................107 Bootinganx86BasedSystem...........................................................................................................107 ▼x86:HowtoBootaSystemtoRunLevel3(Multiuser) .........................................................107 ▼x86:HowtoBootaSystemtoRunLevelS(Single-UserLevel)............................................108 ▼x86:HowtoBootaSystemInteractively.................................................................................109 x86:BootingFromaSpecifiedZFSRootFileSystem....................................................................110 ▼x86:HowtoDisplayaListoftheAvailableZFSBootEnvironments ..................................111 ▼x86:HowtoBootFromaSpecifiedZFSRootFileSystem ....................................................111 UsingFastReboot(TaskMap).........................................................................................................112 UsingFastReboot..............................................................................................................................113 ▼HowtoInitiateaFastRebootofaSPARCBasedSystem ......................................................113 ▼HowtoInitiateaFastRebootofanx86BasedSystem...........................................................114 ▼x86:HowtoFastRebootaSystemtothenthEntryintheGRUBmenu.lstFile ...............114 x86:InitiatingaFastRebootofaSystembySpecifyinganAlternateBootEnvironment.115 PerformingaSlowRebootofaSystem ....................................................................................116 ManagingtheBootConfigurationService .............................................................................116 x86:DebuggingEarlyPanicsThatMightOccur....................................................................117 6 SystemAdministrationGuide:BasicAdministration • November2010 Contents x86:TroubleshootingConditionsThatMightPreventFastRebootFromWorking ........117 Bootinganx86BasedSystemfromtheNetwork...........................................................................118 x86:AboutDHCPMacros ........................................................................................................119 ▼x86:HowtoPerformaGRUBBasedBootFromtheNetwork.............................................121 8 TroubleshootingBootinganOracleSolarisSystem(Tasks).......................................................123 TroubleshootingBootingontheSPARCPlatform(TaskMap) ..................................................123 TroubleshootingBootingontheSPARCPlatform .......................................................................124 ▼SPARC:HowtoStoptheSystemforRecoveryPurposes ......................................................124 SPARC:ForcingaCrashDumpandRebootoftheSystem...................................................125 ▼SPARC:HowtoBootaSystemforRecoveryPurposes .........................................................126 ▼SPARC:HowtoBootaZFSRootEnvironmenttoRecoverFromaLostPasswordorSimilar Problem.......................................................................................................................................128 ▼SPARC:HowtoBoottheSystemWiththeKernelDebugger(kmdb) ..................................129 TroubleshootingBootingonthex86Platform(TaskMap).........................................................130 Troubleshootingonthex86Platform.............................................................................................130 ▼x86:HowtoStopaSystemforRecoveryPurposes ................................................................130 x86:ForcingaCrashDumpandRebootoftheSystem .........................................................131 ▼x86:HowtoBootaSystemWiththeKernelDebuggerintheGRUBBootEnvironment (kmdb)...........................................................................................................................................132 9 ManagingtheOracleSolarisBootArchives(Tasks) ....................................................................135 ManagingtheOracleSolarisBootArchives(TaskMap)..............................................................135 DescriptionoftheOracleSolarisBootArchives ...........................................................................136 Managingtheboot-archiveService..............................................................................................137 ▼HowtoEnableorDisabletheboot-archiveService............................................................137 AdministeringAutomaticBootArchiveRecovery .......................................................................138 ▼x86:HowtoClearAutomaticBootArchiveUpdateFailuresbyUsingthe auto-reboot-safeProperty....................................................................................................138 ▼HowtoClearAutomaticBootArchiveUpdateFailuresbyUsingthebootadm Command...................................................................................................................................139 UsingthebootadmCommandtoManagetheBootArchives ......................................................139 ▼HowtoManuallyUpdatetheBootArchivebyUsingthebootadmCommand..................140 ▼HowtoListContentsoftheBootArchive ..............................................................................140 ▼x86:HowtoLocatetheActiveGRUBMenuandListCurrentMenuEntries.....................141 ▼x86:HowtoSettheDefaultBootEntryfortheActiveGRUBMenu...................................141 7 Contents 10 x86:GRUBBasedBooting(Reference)...........................................................................................143 x86:BootProcesses ...........................................................................................................................143 x86:SystemBIOS .......................................................................................................................143 x86:SupportforGRUBintheOracleSolarisOS...........................................................................144 x86:GRUBTerminology ..........................................................................................................144 x86:FunctionalComponentsofGRUB ..................................................................................145 11 ManagingServices(Overview)........................................................................................................147 IntroductiontoSMF .........................................................................................................................147 ChangesinBehaviorWhenUsingSMF .........................................................................................148 SMFConcepts....................................................................................................................................149 SMFService ................................................................................................................................149 ServiceIdentifiers.......................................................................................................................150 ServiceStates...............................................................................................................................151 SMFManifests............................................................................................................................151 SMFProfiles................................................................................................................................152 ServiceConfigurationRepository............................................................................................152 SMFRepositoryBackups ..........................................................................................................153 SMFSnapshots ...........................................................................................................................153 SMFAdministrativeandProgrammingInterfaces.......................................................................154 SMFCommand-LineAdministrativeUtilities ......................................................................154 ServiceManagementConfigurationLibraryInterfaces........................................................154 SMFComponents .............................................................................................................................155 SMFMasterRestarterDaemon................................................................................................155 SMFDelegatedRestarters.........................................................................................................155 SMFandBooting...............................................................................................................................155 SMFCompatibility............................................................................................................................156 RunLevels ..........................................................................................................................................156 WhentoUseRunLevelsorMilestones...................................................................................157 DeterminingaSystem'sRunLevel...........................................................................................158 /etc/inittabFile.............................................................................................................................158 WhatHappensWhentheSystemIsBroughttoRunLevel3................................................159 12 ManagingServices(Tasks)...............................................................................................................161 ManagingServices(TaskMap)........................................................................................................161 8 SystemAdministrationGuide:BasicAdministration • November2010 Contents MonitoringSMFServices.................................................................................................................162 ▼HowtoListtheStatusofaService............................................................................................162 ▼HowtoShowWhichServicesAreDependentonaServiceInstance ..................................164 ▼HowtoShowWhichServicesaServiceIsDependentOn ....................................................164 ManagingSMFServices(TaskMap)...............................................................................................165 ManagingSMFServices....................................................................................................................165 UsingRBACRightsProfilesWithSMF...................................................................................165 ▼HowtoDisableaServiceInstance............................................................................................166 ▼HowtoEnableaServiceInstance.............................................................................................166 ▼HowtoRestartaService............................................................................................................167 ▼HowtoRestoreaServiceThatIsintheMaintenanceState ..................................................167 ▼HowtoReverttoAnotherSMFSnapshot...............................................................................168 ▼HowtoCreateanSMFProfile ..................................................................................................169 ▼HowtoApplyanSMFProfile ...................................................................................................170 ▼ChangingServicesOfferedtotheNetworkwithgeneric*.xml..........................................171 ConfiguringSMFServices................................................................................................................171 ▼HowtoModifyaService ...........................................................................................................171 ▼HowtoChangeanEnvironmentVariableforaService........................................................172 ▼HowtoChangeaPropertyforaninetdControlledService ................................................173 ▼HowtoModifyaCommand-LineArgumentforaninetdControlledService.................174 ▼HowtoConvertinetd.confEntries.......................................................................................175 UsingRunControlScripts(TaskMap) ..........................................................................................176 UsingRunControlScripts ...............................................................................................................176 ▼HowtoUseaRunControlScripttoStoporStartaLegacyService.....................................176 ▼HowtoAddaRunControlScript............................................................................................177 ▼HowtoDisableaRunControlScript ......................................................................................178 TroubleshootingtheServiceManagementFacility.......................................................................179 ▼DebuggingaServiceThatIsNotStarting ...............................................................................179 ▼HowtoRepairaCorruptRepository.......................................................................................179 ▼HowtoBootWithoutStartingAnyServices ..........................................................................182 ▼HowtoForceasuloginPromptIfthesystem/filesystem/local:defaultServiceFails DuringBoot................................................................................................................................182 Index ...................................................................................................................................................185 9 10
Description: