System Administration Guide: Advanced Administration SunMicrosystems,Inc. 4150NetworkCircle SantaClara,CA95054 U.S.A. PartNo:819–2380–13 May2008 Copyright2008SunMicrosystems,Inc. 4150NetworkCircle,SantaClara,CA95054U.S.A. Allrightsreserved. SunMicrosystems,Inc.hasintellectualpropertyrightsrelatingtotechnologyembodiedintheproductthatisdescribedinthisdocument.Inparticular,andwithout limitation,theseintellectualpropertyrightsmayincludeoneormoreU.S.patentsorpendingpatentapplicationsintheU.S.andinothercountries. U.S.GovernmentRights–Commercialsoftware.GovernmentusersaresubjecttotheSunMicrosystems,Inc.standardlicenseagreementandapplicableprovisions oftheFARanditssupplements. Thisdistributionmayincludematerialsdevelopedbythirdparties. PartsoftheproductmaybederivedfromBerkeleyBSDsystems,licensedfromtheUniversityofCalifornia.UNIXisaregisteredtrademarkintheU.S.andother countries,exclusivelylicensedthroughX/OpenCompany,Ltd. Sun,SunMicrosystems,theSunlogo,theSolarislogo,theJavaCoffeeCuplogo,docs.sun.com,Java,OpenSolaris,SunxVMhypervisor,andSolarisaretrademarksor registeredtrademarksofSunMicrosystems,Inc.intheU.S.andothercountries.AllSPARCtrademarksareusedunderlicenseandaretrademarksorregistered trademarksofSPARCInternational,Inc.intheU.S.andothercountries.ProductsbearingSPARCtrademarksarebaseduponanarchitecturedevelopedbySun Microsystems,Inc.AdobeisaregisteredtrademarkofAdobeSystems,Incorporated.PostScriptisatrademarkorregisteredtrademarkofAdobeSystems, Incorporated,whichmayberegisteredincertainjurisdictions. TheOPENLOOKandSunTMGraphicalUserInterfacewasdevelopedbySunMicrosystems,Inc.foritsusersandlicensees.Sunacknowledgesthepioneeringefforts ofXeroxinresearchinganddevelopingtheconceptofvisualorgraphicaluserinterfacesforthecomputerindustry.Sunholdsanon-exclusivelicensefromXeroxto theXeroxGraphicalUserInterface,whichlicensealsocoversSun'slicenseeswhoimplementOPENLOOKGUIsandotherwisecomplywithSun'swrittenlicense agreements. ProductscoveredbyandinformationcontainedinthispublicationarecontrolledbyU.S.ExportControllawsandmaybesubjecttotheexportorimportlawsin othercountries.Nuclear,missile,chemicalorbiologicalweaponsornuclearmaritimeendusesorendusers,whetherdirectorindirect,arestrictlyprohibited.Export orreexporttocountriessubjecttoU.S.embargoortoentitiesidentifiedonU.S.exportexclusionlists,including,butnotlimitedto,thedeniedpersonsandspecially designatednationalslistsisstrictlyprohibited. DOCUMENTATIONISPROVIDED“ASIS”ANDALLEXPRESSORIMPLIEDCONDITIONS,REPRESENTATIONSANDWARRANTIES,INCLUDINGANY IMPLIEDWARRANTYOFMERCHANTABILITY,FITNESSFORAPARTICULARPURPOSEORNON-INFRINGEMENT,AREDISCLAIMED,EXCEPTTO THEEXTENTTHATSUCHDISCLAIMERSAREHELDTOBELEGALLYINVALID. Copyright2008SunMicrosystems,Inc. 4150NetworkCircle,SantaClara,CA95054U.S.A. Tousdroitsréservés. SunMicrosystems,Inc.détientlesdroitsdepropriétéintellectuellerelatifsàlatechnologieincorporéedansleproduitquiestdécritdanscedocument.Enparticulier, etcesanslimitation,cesdroitsdepropriétéintellectuellepeuventinclureunouplusieursbrevetsaméricainsoudesapplicationsdebrevetenattenteauxEtats-Unis etdansd'autrespays. Cettedistributionpeutcomprendredescomposantsdéveloppéspardestiercespersonnes. CertainescomposantsdeceproduitpeuventêtredérivéesdulogicielBerkeleyBSD,licenciésparl'UniversitédeCalifornie.UNIXestunemarquedéposéeaux Etats-Unisetdansd'autrespays;elleestlicenciéeexclusivementparX/OpenCompany,Ltd. Sun,SunMicrosystems,lelogoSun,lelogoSolaris,lelogoJavaCoffeeCup,docs.sun.com,Java,OpenSolaris,SunxVMhypervisor,etSolarissontdesmarquesde fabriqueoudesmarquesdéposéesdeSunMicrosystems,Inc.auxEtats-Unisetdansd'autrespays.TouteslesmarquesSPARCsontutiliséessouslicenceetsontdes marquesdefabriqueoudesmarquesdéposéesdeSPARCInternational,Inc.auxEtats-Unisetdansd'autrespays.LesproduitsportantlesmarquesSPARCsontbasés surunearchitecturedéveloppéeparSunMicrosystems,Inc.AdobeestunemarqueenregistreedeAdobeSystems,Incorporated.PostScriptestunemarquede fabriqued'AdobeSystems,Incorporated,laquellepourrait?‘tred?pos?edanscertainesjuridictions. L'interfaced'utilisationgraphiqueOPENLOOKetSunaétédéveloppéeparSunMicrosystems,Inc.poursesutilisateursetlicenciés.Sunreconnaîtleseffortsde pionniersdeXeroxpourlarechercheetledéveloppementduconceptdesinterfacesd'utilisationvisuelleougraphiquepourl'industriedel'informatique.Sundétient unelicencenonexclusivedeXeroxsurl'interfaced'utilisationgraphiqueXerox,cettelicencecouvrantégalementleslicenciésdeSunquimettentenplacel'interface d'utilisationgraphiqueOPENLOOKetqui,enoutre,seconformentauxlicencesécritesdeSun. Lesproduitsquifontl'objetdecettepublicationetlesinformationsqu'ilcontientsontrégisparlalegislationaméricaineenmatièredecontrôledesexportationset peuventêtresoumisaudroitd'autrespaysdansledomainedesexportationsetimportations.Lesutilisationsfinales,ouutilisateursfinaux,pourdesarmesnucléaires, desmissiles,desarmeschimiquesoubiologiquesoupourlenucléairemaritime,directementouindirectement,sontstrictementinterdites.Lesexportationsou réexportationsversdespayssousembargodesEtats-Unis,ouversdesentitésfigurantsurleslistesd'exclusiond'exportationaméricaines,ycompris,maisdemanière nonexclusive,lalistedepersonnesquifontobjetd'unordredenepasparticiper,d'unefaçondirecteouindirecte,auxexportationsdesproduitsoudesservicesqui sontrégisparlalegislationaméricaineenmatièredecontrôledesexportationsetlalistederessortissantsspécifiquementdesignés,sontrigoureusementinterdites. LADOCUMENTATIONESTFOURNIE"ENL'ETAT"ETTOUTESAUTRESCONDITIONS,DECLARATIONSETGARANTIESEXPRESSESOUTACITES SONTFORMELLEMENTEXCLUES,DANSLAMESUREAUTORISEEPARLALOIAPPLICABLE,YCOMPRISNOTAMMENTTOUTEGARANTIE IMPLICITERELATIVEALAQUALITEMARCHANDE,AL'APTITUDEAUNEUTILISATIONPARTICULIEREOUAL'ABSENCEDECONTREFACON. 080502@19860 Contents Preface...................................................................................................................................................15 1 ManagingTerminalsandModems(Overview)...............................................................................21 What'sNewinManagingTerminalsandModems? .......................................................................21 SPARC:CoherentConsole .........................................................................................................21 SPARC:ChangestoHow$TERMValueforConsoleIsSet....................................................22 ttymonInvocationsontheSystemConsoleManagedbySMF ..............................................22 Terminals,Modems,Ports,andServices..........................................................................................23 TerminalDescription..................................................................................................................23 ModemDescription.....................................................................................................................23 PortsDescription .........................................................................................................................23 ServicesDescription ....................................................................................................................24 PortMonitors ...............................................................................................................................24 ToolsforManagingTerminalsandModems...................................................................................25 SerialPortsTool ...........................................................................................................................25 ServiceAccessFacility .................................................................................................................25 2 SettingUpTerminalsandModems(Tasks).....................................................................................27 SettingTerminalsandModems(TaskMap)....................................................................................27 SettingUpTerminalsandModemsWithSerialPortsTool(Overview) ......................................28 SettingUpTerminals...................................................................................................................28 SettingUpModems .....................................................................................................................29 HowtoSetUpaTerminal,aModem,andInitializeaPort(Tasks) ..............................................31 ▼HowtoSetUpaTerminal...........................................................................................................31 ▼HowtoSetUpaModem .............................................................................................................31 ▼HowtoInitializeaPort................................................................................................................32 TroubleshootingTerminalandModemProblems .........................................................................33 3 Contents 3 ManagingSerialPortsWiththeServiceAccessFacility(Tasks) ...................................................35 ManagingSerialPorts(TaskMap) ....................................................................................................36 UsingtheServiceAccessFacility .......................................................................................................36 OverallSAFAdministration(sacadm)..............................................................................................37 ServiceAccessController(SACProgram)................................................................................38 SACInitializationProcess...........................................................................................................38 PortMonitorServiceAdministration(pmadm).................................................................................38 ttymonPortMonitor ...................................................................................................................39 PortInitializationProcess...........................................................................................................39 BidirectionalService....................................................................................................................40 TTYMonitorandNetworkListenerPortMonitors .......................................................................40 TTYPortMonitor(ttymon) .......................................................................................................40 ttymonandtheConsolePort......................................................................................................40 ttymon-SpecificAdministrativeCommand(ttyadm).............................................................41 NetworkListenerService(listen)............................................................................................41 Speciallisten-SpecificAdministrativeCommand(nlsadmin) ...........................................42 AdministeringttymonPortMonitors...............................................................................................42 ▼HowtoSetthettymonConsoleTerminalType .......................................................................42 ▼HowtoSettheBaudRateSpeedonthettymonConsoleTerminal .......................................43 ▼HowtoAddattymonPortMonitor...........................................................................................44 ▼HowtoViewttymonPortMonitorStatus ................................................................................44 ▼HowtoStopattymonPortMonitor ..........................................................................................45 ▼HowtoStartattymonPortMonitor..........................................................................................46 ▼HowtoDisableattymonPortMonitor .....................................................................................46 ▼HowtoEnableattymonPortMonitor ......................................................................................46 ▼HowtoRemoveattymonPortMonitor....................................................................................47 Administeringttymonservices(TaskMap).....................................................................................47 AdministeringttymonServices .........................................................................................................48 ▼HowtoAddaService...................................................................................................................48 ▼HowtoViewtheStatusofaTTYPortService..........................................................................49 ▼HowtoEnableaPortMonitorService ......................................................................................51 ▼HowtoDisableaPortMonitorService .....................................................................................51 ServiceAccessFacilityAdministration(Reference)........................................................................51 FilesAssociatedWiththeSAF....................................................................................................52 /etc/saf/_sactabFile ...............................................................................................................52 /etc/saf/pmtab/_pmtabFile....................................................................................................53 4 SystemAdministrationGuide:AdvancedAdministration • May2008 Contents ServiceStates.................................................................................................................................54 PortMonitorStates......................................................................................................................54 PortStates......................................................................................................................................55 4 ManagingSystemResources(Overview) ........................................................................................57 What'sNewinManagingSystemResources?..................................................................................57 prtconfOptiontoDisplayProductNames .............................................................................57 ManagingSystemResources(RoadMap)........................................................................................58 5 DisplayingandChangingSystemInformation(Tasks).................................................................59 DisplayingSystemInformation(TaskMap)....................................................................................59 DisplayingSystemInformation .................................................................................................60 ▼HowtoDetermineWhetheraSystemHas32–bitor64–BitSolarisCapabilities Enabled ..................................................................................................................................61 ▼HowtoDisplaySolarisReleaseInformation.....................................................................64 ▼HowtoDisplayGeneralSystemInformation...................................................................64 ▼HowtoDisplayaSystem'sHostIDNumber.....................................................................65 ▼HowtoDisplayaSystem'sProductName.........................................................................65 ▼HowtoDisplayaSystem'sInstalledMemory ...................................................................66 ▼HowtoDisplaytheDateandTime ....................................................................................66 psrinfoCommandOptiontoIdentifyChipMultithreadingFeatures ................................66 ▼HowtoDisplayaSystem'sPhysicalProcessorType................................................................67 ▼HowtoDisplayaSystem'sLogicalProcessorType .................................................................67 NewlocaleadmCommand ........................................................................................................68 ▼HowtoDisplayLocalesInstalledonaSystem..........................................................................68 ▼HowtoDetermineifaLocaleisInstalledonaSystem ............................................................69 ChangingSystemInformation(TaskMap) .....................................................................................69 ChangingSystemInformation ..........................................................................................................70 ▼HowtoSetaSystem'sDateandTimeManually ......................................................................70 ▼HowtoSetUpaMessage-Of-The-Day .....................................................................................71 ▼HowtoChangeaSystem'sHostName......................................................................................72 ▼HowtoAddaLocaletoaSystem ...............................................................................................73 ▼HowtoRemoveaLocaleFromaSystem...................................................................................73 5 Contents 6 ManagingDiskUse(Tasks) ................................................................................................................75 ManagingDiskUse(TaskMap) ........................................................................................................75 DisplayingInformationAboutFilesandDiskSpace ......................................................................76 ▼HowtoDisplayInformationAboutFilesandDiskSpace.......................................................77 CheckingtheSizeofFiles ...................................................................................................................79 ▼HowtoDisplaytheSizeofFiles..................................................................................................79 ▼HowtoFindLargeFiles...............................................................................................................80 ▼HowtoFindFilesThatExceedaSpecifiedSizeLimit .............................................................82 CheckingtheSizeofDirectories........................................................................................................82 ▼HowtoDisplaytheSizeofDirectories,Subdirectories,andFiles..........................................83 ▼HowtoDisplaytheUserOwnershipofLocalUFSFileSystems............................................84 FindingandRemovingOldorInactiveFiles....................................................................................85 ▼HowtoListtheNewestFiles .......................................................................................................85 ▼HowtoFindandRemoveOldorInactiveFiles........................................................................86 ▼HowtoClearOutTemporaryDirectories................................................................................87 ▼HowtoFindandDeletecoreFiles.............................................................................................88 ▼HowtoDeleteCrashDumpFiles...............................................................................................89 7 ManagingQuotas(Tasks)...................................................................................................................91 WhatAreQuotas? ...............................................................................................................................91 UsingQuotas .......................................................................................................................................91 SettingSoftLimitsandHardLimitsforQuotas.......................................................................92 TheDifferenceBetweenDiskBlockandFileLimits................................................................92 SettingUpQuotas ...............................................................................................................................92 GuidelinesforSettingUpQuotas ..............................................................................................93 SettingUpQuotas(TaskMap) ..........................................................................................................94 ▼HowtoConfigureFileSystemsforQuotas...............................................................................94 ▼HowtoSetUpQuotasforaUser ...............................................................................................95 ▼HowtoSetUpQuotasforMultipleUsers.................................................................................96 ▼HowtoCheckQuotaConsistency.............................................................................................96 ▼HowtoTurnOnQuotas .............................................................................................................97 MaintainingQuotas(TaskMap).......................................................................................................98 CheckingQuotas .................................................................................................................................99 ▼HowtoCheckforExceededQuotas ..........................................................................................99 ▼HowtoCheckQuotasonaFileSystem...................................................................................100 6 SystemAdministrationGuide:AdvancedAdministration • May2008 Contents ChangingandRemovingQuotas ....................................................................................................101 ▼HowtoChangetheSoftLimitDefault ....................................................................................101 ▼HowtoChangeQuotasforaUser ...........................................................................................102 ▼HowtoDisableQuotasforaUser............................................................................................103 ▼HowtoTurnOffQuotas ...........................................................................................................104 8 SchedulingSystemTasks(Tasks) ....................................................................................................107 CreatingandEditingcrontabFiles(TaskMap) ...........................................................................107 WaystoAutomaticallyExecuteSystemTasks...............................................................................108 ForSchedulingRepetitiveJobs:crontab ................................................................................109 ForSchedulingaSingleJob:at.................................................................................................109 SchedulingaRepetitiveSystemTask(cron)..................................................................................110 InsideacrontabFile..................................................................................................................110 HowthecronDaemonHandlesScheduling ..........................................................................111 SyntaxofcrontabFileEntries..................................................................................................112 CreatingandEditingcrontabFiles.................................................................................................112 ▼HowtoCreateorEditacrontabFile.......................................................................................113 ▼HowtoVerifyThatacrontabFileExists................................................................................114 DisplayingcrontabFiles ..................................................................................................................114 ▼HowtoDisplayacrontabFile .................................................................................................115 RemovingcrontabFiles...................................................................................................................116 ▼HowtoRemoveacrontabFile.................................................................................................116 ControllingAccesstothecrontabCommand ..............................................................................117 ▼HowtoDenycrontabCommandAccess...............................................................................118 ▼HowtoLimitcrontabCommandAccesstoSpecifiedUsers ...............................................118 HowtoVerifyLimitedcrontabCommandAccess...............................................................119 UsingtheatCommand(TaskMap)...............................................................................................120 SchedulingaSingleSystemTask(at) .............................................................................................121 DescriptionoftheatCommand..............................................................................................121 ControllingAccesstotheatCommand .................................................................................122 ▼HowtoCreateanatJob ............................................................................................................122 ▼HowtoDisplaytheatQueue ...................................................................................................123 ▼HowtoVerifyanatJob.............................................................................................................123 ▼HowtoDisplayatJobs..............................................................................................................124 ▼HowtoRemoveatJobs.............................................................................................................124 7 Contents ▼HowtoDenyAccesstotheatCommand...............................................................................125 ▼HowtoVerifyThatatCommandAccessIsDenied .............................................................126 9 ManagingSystemAccounting(Tasks) ...........................................................................................127 What'sNewinSystemAccounting .................................................................................................127 SolarisProcessAccountingandStatisticsImprovements ....................................................127 WhatisSystemAccounting?............................................................................................................128 HowSystemAccountingWorks ..............................................................................................128 SystemAccountingComponents ............................................................................................128 SystemAccounting(TaskMap) ......................................................................................................132 SettingUpSystemAccounting ........................................................................................................133 ▼HowtoSetUpSystemAccounting ..........................................................................................133 BillingUsers .......................................................................................................................................135 ▼HowtoBillUsers........................................................................................................................136 MaintainingAccountingInformation............................................................................................136 FixingCorruptedFilesandwtmpxErrors................................................................................136 ▼HowtoFixaCorruptedwtmpxFile ..........................................................................................137 FixingtacctErrors....................................................................................................................137 ▼HowtoFixtacctErrors ...........................................................................................................137 RestartingtherunacctScript...................................................................................................138 ▼HowtoRestarttherunacctScript...........................................................................................138 StoppingandDisablingSystemAccounting..................................................................................139 ▼HowtoTemporarilyStopSystemAccounting.......................................................................139 ▼HowtoPermanentlyDisableSystemAccounting .................................................................140 10 SystemAccounting(Reference) ......................................................................................................141 runacctScript....................................................................................................................................141 DailyAccountingReports ................................................................................................................144 DailyReport................................................................................................................................144 DailyUsageReport ....................................................................................................................145 DailyCommandSummary.......................................................................................................146 MonthlyCommandSummary.................................................................................................148 LastLoginReport.......................................................................................................................148 ExaminingthepacctFileWithacctcom ................................................................................149 SystemAccountingFiles...................................................................................................................151 8 SystemAdministrationGuide:AdvancedAdministration • May2008 Contents FilesProducedbytherunacctScript ......................................................................................153 11 ManagingSystemPerformance(Overview).................................................................................155 What'sNewinManagingSystemPerformance? ...........................................................................155 EnhancedpfilesTool..............................................................................................................155 CPUPerformanceCounters.....................................................................................................155 WheretoFindSystemPerformanceTasks.....................................................................................156 SystemPerformanceandSystemResources ..................................................................................157 ProcessesandSystemPerformance.................................................................................................157 AboutMonitoringSystemPerformance ........................................................................................158 MonitoringTools.......................................................................................................................159 12 ManagingSystemProcesses(Tasks) ..............................................................................................161 ManagingSystemProcesses(TaskMap)........................................................................................161 CommandsforManagingSystemProcesses .................................................................................162 UsingthepsCommand ............................................................................................................163 Usingthe/procFileSystemandCommands ........................................................................164 ManagingProcessesWithProcessCommands(/proc).......................................................165 ▼HowtoListProcesses ................................................................................................................165 ▼HowtoDisplayInformationAboutProcesses .......................................................................167 ▼HowtoControlProcesses.........................................................................................................168 TerminatingaProcess(pkill,kill) ....................................................................................169 ▼HowtoTerminateaProcess(pkill).......................................................................................169 ▼HowtoTerminateaProcess(kill).........................................................................................170 DebuggingaProcess(pargs,preap) .......................................................................................171 ManagingProcessClassInformation(TaskMap) ........................................................................172 ManagingProcessClassInformation .............................................................................................173 ChangingtheSchedulingPriorityofProcesses(priocntl) .................................................173 ▼HowtoDisplayBasicInformationAboutProcessClasses(priocntl) ..............................174 ▼HowtoDisplaytheGlobalPriorityofaProcess.....................................................................174 ▼HowtoDesignateaProcessPriority(priocntl)...................................................................175 ▼HowtoChangeSchedulingParametersofaTimesharingProcess(priocntl).................176 ▼HowtoChangetheClassofaProcess(priocntl).................................................................176 ChangingthePriorityofaTimesharingProcess(nice) .......................................................177 ▼HowtoChangethePriorityofaProcess(nice).....................................................................178 9 Contents TroubleshootingProblemsWithSystemProcesses......................................................................179 13 MonitoringSystemPerformance(Tasks) ......................................................................................181 DisplayingSystemPerformanceInformation(TaskMap) ..........................................................181 DisplayingVirtualMemoryStatistics(vmstat) ............................................................................182 ▼HowtoDisplayVirtualMemoryStatistics(vmstat).............................................................183 ▼HowtoDisplaySystemEventInformation(vmstat-s)......................................................184 ▼HowtoDisplaySwappingStatistics(vmstat-S) ..................................................................185 ▼HowtoDisplayInterruptsPerDevice(vmstat-i) ..............................................................185 DisplayingDiskUtilizationInformation(iostat).......................................................................186 ▼HowtoDisplayDiskUtilizationInformation(iostat) .......................................................186 ▼HowtoDisplayExtendedDiskStatistics(iostat-xtc)......................................................187 DisplayingDiskSpaceStatistics(df) ..............................................................................................188 ▼HowtoDisplayDiskSpaceInformation(df-k)...................................................................188 MonitoringSystemActivities(TaskMap) .....................................................................................189 MonitoringSystemActivities(sar) ................................................................................................191 ▼HowtoCheckFileAccess(sar-a) .........................................................................................191 ▼HowtoCheckBufferActivity(sar-b)...................................................................................192 ▼HowtoCheckSystemCallStatistics(sar-c)........................................................................193 ▼HowtoCheckDiskActivity(sar-d) .....................................................................................195 ▼HowtoCheckPage-OutandMemory(sar-g) ....................................................................196 CheckingKernelMemoryAllocation......................................................................................198 ▼HowtoCheckKernelMemoryAllocation(sar-k) .............................................................198 ▼HowtoCheckInterprocessCommunication(sar-m) ........................................................200 ▼HowtoCheckPage-InActivity(sar-p) ................................................................................201 ▼HowtoCheckQueueActivity(sar-q)..................................................................................202 ▼HowtoCheckUnusedMemory(sar-r)...............................................................................203 ▼HowtoCheckCPUUtilization(sar-u)................................................................................204 ▼HowtoCheckSystemTableStatus(sar-v)..........................................................................206 ▼HowtoCheckSwappingActivity(sar-w) ............................................................................207 ▼HowtoCheckTerminalActivity(sar-y) .............................................................................208 ▼HowtoCheckOverallSystemPerformance(sar-A) ..........................................................209 CollectingSystemActivityDataAutomatically(sar) ..................................................................210 RunningthesadcCommandWhenBooting.........................................................................210 RunningthesadcCommandPeriodicallyWiththesa1Script...........................................210 10 SystemAdministrationGuide:AdvancedAdministration • May2008
Description: