Solaris-Admin mit Notizen

Download Report

Transcript Solaris-Admin mit Notizen

Solaris - Systemadministration
Rechenzentrum
Universität
Stuttgart
[email protected]
1. Einführung
1. Einführung

Kursablauf

Inhalt

Umfang

Zielgruppe
Inhalt
1)
2)
3)
4)
5)
6)
7)
8)
9)
Einführung
Solaris-Umfang
Solaris-Installation
Der Monitor
Der Bootvorgang
Softwareinstallation
Patchinstallation
Solaris-Dateisysteme
Eigene Dateisysteme
10)
11)
12)
13)
14)
15)
16)
17)
NFS
NIS
Benutzerverwaltung
Netzwerkverwaltung
Systemdienste
Backup – Restore
SUN-Serviceangebot
Weitere Informationen
Aufgaben des Sysadmin
What are system administrators?
In general, sysadmins are those people we complain to when our computer
systems aren't working the way we expect. If they can make everything
right, then they must be system administrators. Therefore, a system
administrator is someone who solves problems in computer and network
systems operations.
Tasks of the system administrators :
The problem set in computing and network operations generally includes
all those system tasks users might want to offload -- specification,
evaluation, installation, configuration, integration, maintenance, dataintegrity management, upgrade management, automation, security
management, performance analysis, failure analysis,failure mitigation,
recovery design, recovery implementation, testing, and more.
From: Dr. Dobb's Journal Fall 1999 “The future looks bright for problem solvers”.
By Barbara Dijker (vice president of the System Administrators' Guild (SAGE))
Ziele

Grundlegende UND Solaris-spezifische Infos
zum Betrieb von SUN-SPARC-Systemen
(nicht INTEL!)
SUN-Systeme
http://www.sun.de/Produkte/Hardware/index.html
2. Solaris-Umfang
Solaris-Software

Solaris-Aufbau:
–
–
–
–




SunOS (Kernel) für SPARC, Intel, PowerPC
Open Network Computing (TCP/IP, …)
Graphische Oberfläche (CDE, …)
Deskset-Tools (Shells, Audiotool, …)
Solaris 1
Solaris 2.x
Solaris 7
Solaris 8
=> SunOS 4.x
=> SunOS 5.x , bis 5.6
=> SunOS 5.7
=> SunOS 5.8
(BSD)
(SVR4)
( `` )
( `` )
Zusatz-Software
SUN Management Center (SyMON)
 Oracle 8i Enterprise Edition (Solaris 8)
 StarOffice
 Netscape
 Freeware
…
 DiskSuite

DiskSuite-Funktionen









Disk mirroring and RAID-5
Hot-spare facility
Disk striping
UNIX logging
Alternate path support
A graphical user interface
A performance monitor
Concatenation and “grow file system” command
SNMP traps
DiskSuite-Versionen

Solaris 7 oder Solaris 2.6 Server Version
Bestandteil des Solaris Easy Access Server

Solaris 8: base platform
3. Solaris-Installation
Installationsarten

Neuinstallation

Aktualisierung
Installationsmethoden

Interaktive Installation
– Von lokaler CD-ROM [> boot cdrom]

WebStart (ab Solaris 8)
– Von lokaler CD-ROM [> boot cdrom]

Interaktive Netz-Installation
– Installations- und Bootserver erforderlich [> boot net]

JumpStart
– Bei Neusystemen von vorinstalliertem Image [autom.]

Custom JumpStart
– Für “große” Installationen [> boot net]
Installation über Uni-Netz

s. “Installation SOLARIS 7 über das Rechnernetz der
Universität Stuttgart” auf:
http://sunswsrv.rus.uni-stuttgart.de/WSBetreuung_HomePage/SUN/contents/solaris/sol7.html
Beginn der Installation

Monitor-Modus (Boot/ok-Prompt)
– “shutdown –i0” oder
– “halt” oder
– [Stop]+[A] oder
– [Break]

boot cdrom (net)
Daten für die Installation






Hostname
IP-Adresse
Netzmaske
Nameservice
Zeitzone
Festplattenaufteilung

Rechnertyp
– Standalone
– Server


Umfang der
Betriebssystem-software
Root-Kennwort
Festplattenaufteilung - I

Benötigter Plattenplatz:
–
–
–
–

Entire Distribution Plus OEM Support
Entire Distribution
Developer System Support
End User System Support
2.4 Gbytes
2.3 Gbytes
1.9 Gbytes
1.6 Gbytes
Create a minimum number of file systems.
By default, the Solaris 8 creates only
– root (/),
– /usr
– /swap
Festplattenaufteilung – II
0
1
2
3
/
Swap
Backup
/var
4
5 /opt
6 /usr
7 /export
Root-FS
Swap-Space und /tmp
Gesamte Platte (overlap)
Variable Daten (Printing, Mail,
Logs, Dumps…)
Optionale SW (Third Party)
System-Programme
Heimverzeichnisse, Daten, …
4. Der Monitor
Monitor-Befehle

Booten

– boot [disk|net|cdrom|…]

Diagnose
– test-all
– test floppy (memory/net)
Hilfe
– help

System Informationen
–
–
–
–
.enet-addr
probe-scsi
probe-scsi-all
show-disks

NVRAM-Parameter
–
–
–
–
printenv
Setenv pn pv
Setdefault pn
Set-defaults
NVRAM-Parameter

Monitor:
– Printenv

SunOS:
– eeprom
> diag-level
> keyboard-click?=false
> output-device
> input-device
> boot-command
> auto-boot?
> watchdog-reboot?
> boot-device
> security-mode
> security-password:
> diag-switch?
>…
=max
=screen
=keyboard
=boot
=true
=true
=disk net
=none
data not available.
=false
5. Der Bootvorgang
Booten
Einschalten (wenn autoboot=true)
 Reboot (aus OS, wenn autoboot=true)
 Boot (im Monitor Prompt)

 Kernel wird geladen (/kernel/genunix)
 Nachladen von Kernelmodulen
 /etc/system verarbeiten
 Starten des init-Prozesses
/etc/system

Setzen von Kernelvariablen





rootdev: <device name>
rootfs: <type>
moddir:
set [<mod>:]<sym>
= <value>
# rootdev:/sbus@1,f8000000/esp@…
# rootfs:ufs
# moddir: /kernel /other/modules
# set maxusers=40
# set shmsys:shminfo_shmmax=523288
Ladbare Module



exclude: <subdir>/<name> # exclude: sys/shmsys
include: <subdir>/<name> # include: other/mymod
forceload:<subdir>/<name>
# forceload: drv/socal
Prozeßinitialisierung durch “init”
Init wird vom kernel beim booten gestartet
 pid = 1
 Versetzt das System in den

– Angegebenen Runlevel (z.B. init 0) oder
– Default-Runlevel laut /etc/inittab

Startet die Scripte aus /etc/inittab
Runlevel
0 = Shutdown-Zustand
 1 = Administrations-Zustand
 2 = Mehrbenutzerbetrieb
 3 = Mehrbenutzerbetrieb mit Netzwerk
 5 = Reboot interaktiv (boot –a)
 6 = Reboot (inittab-Default)
 S oder s = Single-User Zustand (boot –s)

/etc/inittab – I
zsdjh:~<14:02-66> cat /etc/inittab
ap::sysinit:/sbin/autopush -f /etc/iu.ap
ap::sysinit:/sbin/soconfig -f /etc/sock2path
fs::sysinit:/sbin/rcS
>/dev/console …
is:3:initdefault:
p3:s1234:powerfail:/usr/sbin/shutdown -y -i5 -g0 >/dev/console …
s0:0:wait:/sbin/rc0
>/dev/console …
s1:1:wait:/usr/sbin/shutdown -y -iS -g0 >/dev/console …
s2:23:wait:/sbin/rc2
>/dev/console …
s3:3:wait:/sbin/rc3
>/dev/console …
s5:5:wait:/sbin/rc5
>/dev/console …
/etc/inittab - II
s0 : 0 : wait : /sbin/rc0 >/dev/console…
Ausgabeumleitung
Auszuführendes Kommando
Steuerungsbefehl für init ->
Runlevel fuer die Abarbeitung der Zeile
Kennzeichen der Zeile (Label)
Steuerungsbefehle für init
wait
 sysinit
 initdefault
 respawn / ondemand
 off
 once

boot
 bootwait
 powerfail
 powerwait

Von init ausgeführte Kommandos

Init führt aus:
– /sbin/rc?

(? =runlevel-Nummer)
/sbin/rc? Führt aus:
– /etc/rc?.d/S* beim Start
– /etc/rc?.d/K* beim Beenden
(/etc/rc?.d/* sind Links nach /etc/init.d/*)
6. Softwareinstallation
Softwareinstallation

Packagemanagement über Befehlszeile
– Pkgadd
– Pkgrm

- Pkginfo
- Pkgask
- Pkgchk
Graphischer Softwaremanager
– Swmtool (admintool -> Software)
SW-Packages von:

Solaris-CDROMs

sunswsrv.rus.uni-stuttgart.de:/cdrom_copies/…
http://sunswsrv.rus.uni-stuttgart.de/WS-Betreuung_HomePage/SUN/

Third Party …
Beispiel: “8Pac Compiler”

Installation:
/sunswsrv/cdrom_copies/8-PAC/
University_Edition/devpro_v8n1_sparc/installer

Lizenz-Installation:
– Am Ende frägt "License Installation Tool", nach Datei mit
Lizenzkeys oder deren manueller Eingabe
– Lizenzfile (für domainname "uni-stuttgart.de") unter
sunswsrv:/general_data/Lizenz/Technisches/sunpro.lic,sp

Spätere Lizenz-Installation:
/etc/opt/licenses/lit
7. Patchinstallation
Patches von:
SunSolve-CDROMs (Wartungsvertrag)
 http://sunsolve.sun.de …patches
 http://metalab.unc.edu/pub/sun-info/sun-patches/


sunswsrv.rus.uni-stuttgart.de:/patches/…
http://sunswsrv.rus.uni-stuttgart.de/WS-Betreuung_HomePage/SUN/
Patches über sunswsrv - I


Über NFS mounten:
sunswsrv.rus.uni-stuttgart.de:/patches
Dateien / Unterverzeichnisse:
–
–
–
–
–
–
Recommended Patches
Patch Reports
PatchSummary
Unbundled_Recommended_list
Files (d)
Pcfiles (d)
Patches über sunswsrv - II

Auswählen der Patches (z.B security Patches)

READMEs der einzelnen Patches lesen

Patchinstall
(halbautomatischen Installieren von Patches)
 Einzelne Patches oder
 Patchlist
oder
 “manuelle” Patchinstallation
“Manuelle” Patchinstallation

Patcheinstallation bis Solaris 2.6
– Patches mit gzip komprimiert => gunzip
– installpatch (bei jedem Patch mitgeliefert)
– backoutpatch (bei jedem Patch mitgeliefert)

Patcheinstallation ab Solaris 7
– Patches mit zip komprimiert => unzip
– patchadd
– patchrm
patchadd / patchrm

Einen Patch installieren:
– patchadd [-d] [-u] [-B backout_dir] patch

Mehrere Patches installieren:
– patchadd [-d] [-u] [-B backout_dir]
-M patch_dir patch_id... | patch_dir patch_list

Auflisten:
– patchadd –p

(alt: showrev –p)
Entfernen:
– patchrm [-f] [-B backout_dir] patch_id
8. Solaris-Dateisysteme
Dateisystem-Überblick

Lokale Dateisysteme
–
–
–
–
–

ufs (default disk-based file system for Solaris)
hsfs (CDs)
tmpfs (uses swap space)
cachefs (NFS or HSFS can be cached)
procfs (process file system in memory)
Netzwerkdateisysteme
– NFS (Network File System)
– DFS (Distributed File System)
/ - Dateibaum - I








/bin
/dev
/devices
/etc
/export
/home
/kernel
/lost+found








/mnt
/net
/opt
/proc
/sbin
/tmp
/usr
/var
/ - Dateibaum - II

/bin
- Binaries
Link auf /usr/bin (UNIX-Betriebssystemkommandos)


/export
/home
- Exportierte Verzeichnisse
- Benutzer-Heimverzeichnisse
Oft auch unter /export/home!



/kernel - Kernel und Kernelmodule
/lost+found - fsck-Hilfsverzeichnis
/mnt
- Leeres Verz. Für Mounts
/ - Dateibaum - III




/net
/opt
/proc
/sbin
- Netzverzeichnisse
- Optionale Software
- Prozeßinformationen (ps)
- Startup-Binaries
Kommandos für die Initialisierungsphase
z.B. rc*-Scripts

/tmp
- Kernel und Kernelmodule
/dev – logische Gerätenamen
Verweis auf die physikalischen Geräte in /devices
 /dsk
- Block-Devices
 /rdsk
- Raw-/ Character-Devices
 /rmt
- Tape-Devices
 /term
- Terminal-Devices
 /cua
- Modems
 /pts
- Pseudo- (Software-)Devices
 /fbs
- Frame-Buffer
Logische Platten-Devicenamen
cwtxdysz
Bsp: /dev/dsk/c0t0d0s0
Slice- / Partitionsnummer (0…7)
Drive-Nummer (LUN, 0-3)
Target-Nummer (SCSI-Adresse, 0-6)
Controller-Nummer
Logische Tape-Devicenamen
X[Y][b][n]
Bsp: /dev/rmt/0hn
No-rewind
SunOS-4.x-Kompatibilität
Denisity (l,m,h,u,c)
Laufwerksnummer (0 … 127)
/devices – physikalische Geräte
Aufbau durch:
 Reconfigure-Boot
– boot -r
– Boot mit Datei “reconfigure” im /-Verzeichnis
drvconfig zur Laufzeit (link auf devfsadm bei Sol.8)
 devfsadm (Sol. 8 / Hot-Plug) zur Laufzeit

Physische-Devicenamen
/devices/sbus@1f,0/espdma@e,8400000/esp@e,8800000/sd@0,0:a
SCSI-Controller
SBUS-Slot
SCSI-Disk
SCSI-Adresse 0
Partition 0 (a)
! Hardware-spezifische Adressen !
/etc - Konfigurationsdateien

Konfigurationsdateien (u.a):
– passwd, group, vfstab, …

Konfigurationsverzeichnisse (u.a.):
–
–
–
–
–
–
–
/dfs
/cron.d
/default
/inet
/init.d
/rc?.d
/skel
- dfstab, sharetab, …
- cron.deny, …
- Standard-Systemkonfiguration
- Netzdateien (hosts, …)
- Startdateien
- Startdateien (Link auf init.d)
- Dateien für neuen Benutzer
/usr - Systemdateien








/bin
/include
/lib
/openwin
/sadm
/sbin
/share
/ucb
- UNIX-Kommandos
- Header-Files für SW-Entwicklung
- Libraries
- OpenWindows, X-Kommandos
- SW-Administration
- Systemkommandos
- Architekturunabhängige Daten
- BSD-Kompatible Binaries
/var – variable Systemdateien







/adm
/cron
/ldap
/log
/sadm
/spool
/yp
- Log-/Accounting-Dateien (messages)
- Cron-Logs
- Lightweight Directory Access Protocol
- syslog
- Software-Administration
- Spooling für Mail, Printing, …
- NIS-Maps
9. Eigene lokale Dateisysteme
Erstellen von Dateisystemen
Platte anschliessen
 Platte formatieren
 Platte partitionieren
 Dateisystem anlegen
 Dateisystem einhängen


Dateisystem prüfen
=> boot –r
=> format
=> format
=> newfs
=> mount
=> fsck
Format – FORMAT-MENU









disk
format
partition
label
current
repair
analyze
inquiry
volname
- select a disk
- format and analyze the disk
- select (define) a partition table
- write label to the disk
- describe the current disk
- repair a defective sector
- surface analysis
- show vendor, product and revision
- set 8-character volume name
Format – PARTITION-MENU











0
- change `0' partition
1
- change `1' partition
2
- change `2' partition
3
- change `3' partition
4
- change `4' partition
5
- change `5' partition
6
- change `6' partition
7
- change `7' partition
print - display the current table
label - write partition map and label to the disk
quit
Format – Partitionstabelle
partition> pr
Part Tag Flag
0
root
wm
1
swap wu
2 backup wm
3
var
wm
4 unassigned wm
5 unassigned wm
6 alternates wm
7 alternates wm
Cylinders
0 - 890
891 - 1113
0 - 7505
1114 - 2004
2005 - 2227
0
2228 - 4008
4009 - 7505
Size
2.00GB
513.07MB
16.86GB
2.00GB
513.07MB
0
4.00GB
7.86GB
Blocks
(891/0/0) 4198392
(223/0/0) 1050776
(7506/0/0) 35368272
(891/0/0) 4198392
(223/0/0) 1050776
(0/0/0)
0
(1781/0/0) 8392072
(3497/0/0) 16477864
Format – Tags / Flags

Tag
– A numeric value that usually describes the file system mounted
on this partition.
– 0=UNASSIGNED 1=BOOT 2=ROOT 3=SWAP 4=USR
5=BACKUP 6=STAND 7=VAR 8=HOME 9=ALTERNATES

Flag
– wm
– wu
– rm
Partition is writable and mountable.
Partition is writable and unmountable.
(Default state for swap areas)
Partition is read only and mountable.
newfs
example# newfs -Nv /dev/rdsk/c0t0d0s6
mkfs -F ufs -o N /dev/rdsk/c0t0d0s6 1112940 54 15 8192 1024 16 10 60
2048 t 0 -1 8 /dev/rdsk/c0t0d0s6: 1112940 sectors in
1374 cylinders of 15 tracks, 54 sectors 569.8MB in 86 cyl
groups (16 c/g, 6.64MB/g, 3072 i/g) super-block backups
(for fsck -b #) at:
32, 13056, 26080, 39104, 52128, 65152, 78176, 91200, 104224, ...
Dateisystem einhängen - I
example# mount /dev/dsk/c0t1d0s6 /scr2
example# df -k
Filesystem
kbytes
used
/dev/dsk/c0t0d0s0 1914318
1693736
/proc
0
0
swap
46208
80
sunswsrv.rus.uni-stuttgart.de:/patches
3297328
3177016
/dev/dsk/c0t1d0s6 980030
9
example# umount /src2
avail
163153
0
46128
capacity Mounted on
92%
/
0%
/proc
1%
/tmp
87344
882018
98% /sunswsrv/patches
1%
/scr2
Dateisystem einhängen - II
example# vi
/etc/vfstab
#device
device
mount FS
fsck
mount mount
#to mount
to fsck
point type
pass
at boot options
#-----------------------------------------------------------------------------------------------/proc
/proc proc
no
/dev/dsk/c0t0d0s0 /dev/rdsk/c0t0d0s0 /
ufs
1
no
/dev/dsk/c0t0d0s1 swap no
swap
/tmp
tmpfs yes
/dev/dsk/c0t1d0s6 /dev/rdsk/c0t1d0s6 /scr2
ufs
2
no
-
example# mountall
Der Automounter (autofs) - I
Automatisches Ein- und Aushängen von
Dateisystemen bei Bedarf
 Lokale und entfernte (NFS-) Dateisysteme
 Starten:

– /etc/init.d/autofs start
– /etc/rc2.d/S74autofs

Stoppen:
– /etc/init.d/autofs stop
(manuell)
(beim booten)
Der Automounter (autofs) - II
Konfiguration über “automounter-Maps”
– Master-Map
– Direkte Maps


(/etc/auto_master)
“/-” als Kennzeichen in Master-Map
Absolute Pfade
– Indirekte Maps


Verzeichnis angegeben in Master-Map
Relative Pfade
– Ausführbare Maps
– Build-In-Maps
(/net)
Dateisystem prüfen
example# umount /dev/dsk/c0t1d0s6
example# fsck /dev/rdsk/c0t1d0s6
** /dev/rdsk/c0t1d0s6
** Last Mounted on /scr2
** Phase 1 - Check Blocks and Sizes
** Phase 2 - Check Pathnames
** Phase 3 - Check Connectivity
** Phase 4 - Check Reference Counts
** Phase 5 - Check Cyl groups
3 files, 9 used, 980021 free
(13 frags, 122501 blocks, 0.0% fragmentation)
Sonstige Dateisystem-Befehle
df - number of free disk blocks and files
 du - summarize disk usage
 ff - list file names and statistics of a FS
 fuser
- identify processes using a file
 sync
- Update Filesystem
 tunefs
- tune up an existing file system

Auswechselbare Datenträger

eject - eject media such as CD-ROM and floppy
example# eject cd

fdformat - format floppy / PCMCIA memory card
example# fdformat /dev/diskette

mt - magnetic tape control
example# mt -f /dev/rmt/0 status
Volume-Management

/etc/init.d/volmgt start

volcheck

/etc/init.d/volmgt stop
- check entpr. /etc/vold.conf
– Bei “manuellem” Umgang mit Datenträgern.
Sonst Fehlermeldung “device busy”
Swap

Ueberprüfen:
– example# swap -s

Hinzufügen:
– example# mkfile -v 32m /swap2fs
– Example# swap -a /swap2fs
(Ggf. in /etc/vfstab: /swap2fs - - swap - no -)

Entfernen:
– Example# swap -d /swap2fs
– example# rm /swap2fs
// Swap-File löschen
10. Network File System (NFS)
Network File System (NFS)
NFS-Server
/root-Verzeichnis
/...
/export
/home
/alfons
/berta
/caecilie
/dora
/...
NFS-Client(s)
/root-Verzeichnis
/...
/home
/alfons
/berta
/caecilie
/dora
/...
/...
/...
# share /export/home
# mount NFS-Server:/export/home
/home
Vorteile von NFS
Konsistenter Zugriff mehrerer Rechner auf die
gleichen Dateien
 Transparent fuer den Benutzer
 Heterogene Umgebungen
 Reduziert Administrationsaufwand
 Reduziert Plattenkosten

NFS-Dateisysteme exportieren - I

share [-F FSType] [-o options] [-d descr] [ pathname]
– -o ro|rw|root[=access_list]
wobei access-list:




[-]client[:[-]client]...
[-]netgroup[:[-]netgroup]...
[-].domain name suffix[:[-].domain name suffix]
[-]@network[:[-]@network]
Beispiel: “share -F nfs -o [email protected]:[email protected] /disk”
NFS-Dateisysteme exportieren - II

share [-F FSType] [-o options] [-d descr] [ pathname]
–
–
–
–
-o anon=uid
-o log=tag
-o nosub
-o nosuid
(uid für unbekannte Benutzer)
(tag ist definiert in /etc/nfs/nfslog.conf)
(keine Mounts von Unterverzeichnissen)
(setuid, setgid verboten)
NFS-Dateisysteme exportieren - III

unshare [pathname]


shareall [-F FSType [,FSType ...]] [ -| file ]
unshareall [-F FSType [,FSType ...]]

/etc/dfs/dfstab
- Default-Datei für [un]shareall
- enthält share-Befehle
- Autom. Ausführung in run-level 3
NFS-Dateisysteme testen

share
showmount [-a] [-d] [-e] [host]
dfmounts [host]
dfshares [host]
nfsstat [-cnrsmza]

mount [ -p | -v ]




(auf dem Client)
NFS-Dateisysteme importieren - I

Manuelles Ein- / Abhängen einzelner Dateisysteme:
–
–

mount [–r] <server>:<pfad> <Mountpunkt>
umount [–f] <Mountpunkt>
Manuelles Ein- / Abhängen über vfstab:
–
–
mountall [ -F FSType ] [ -l | -r ]
umountall [ -k ] [ [ -h host ] | [ -F FSType ] [ -l | -r ] ]
NFS-Dateisysteme importieren - II
example# vi
/etc/vfstab
#device
device
mount FS
fsck
mount mount
#to mount
to fsck
point type
pass
at boot options
#-----------------------------------------------------------------------------------------------/dev/dsk/c0t0d0s0 /dev/rdsk/c0t0d0s0 /
ufs
1
no
/proc
/proc
proc
no
/dev/dsk/c0t0d0s1
swap
no
swap
/tmp
tmpfs
yes
appl-b:/raid
-
example# mountall
/appl/raid nfs
-
yes rw,hard,timeo=50, \
bg,nosuid,largefiles
NFS-Dateisysteme importieren - III

Einhaengen beim Booten:
–

über /etc/vfstab
Autom. Einhängen bei Bedarf:
–
Automounter (autofs)
NFS starten / stoppen

NFS-Server starten (für Export)
– Manuell: “/etc/init.d/nfs.server {start | stop}”
– Beim Booten: Start in rc3.d, (Nur wenn dfstab
vorhanden!) Stop in rc{0,1,S}.d

NFS-Client Prozesse starten
– Manuell: “/etc/init.d/nfs.client {start | stop}”
– Beim Booten: Start in rc2.d, Stop in rc0.d
NFS - Prozesse

NFS-Server Prozesse:
–
–
–
–

nfsd
mountd
(nfslogd)
rpcbind
Bearbeiten der Client-Anfragen (mehrf.)
Einhängen loker Dateisysteme
(nur bei Dateisystemen mit log-Option)
(gestartet von: /etc/init.d/rpc)
NFS-Client Prozesse (laufen auch auf Server):
– lockd
– statd
Locking von Dateien / Dateisätzen
Statusverarbeitung für Wiederanlauf nach Crash
Das chachfs – Dateisystem - I

Vorteile:
– Schnellerer Zugriff auf langsame Dateisysteme (NFS)
– Reduzierung der Netzwerkbelastung (bei NFS)

Tipps:
– Nur häufig verwendete Dateisysteme cachen (homes)
– cachefs auf mögl. unbelasteter Platte (eigene Partition)
– AnswerBook2 · System Administration Guide, Volume I:
http://sunswsrv.rus.unistuttgart.de:8888/ab2/coll.47.5/SYSADV1/@Ab2PageView/44877;td=1?
Das chachfs – Dateisystem – II
Anwendung
read
write (around)
cachefs
lokal
entfernt
Netzwerk
read
write
NFS
chachfs – Verwaltung - I

Anlegen
– cfsadmin -c [ -o cacheFS-parameters ] cache_directory
Beispiel:
# cfsadmin -c /cache

Benutzen
– mount –F cachefs [generic_options] –o backfstype=nfs,
cachedir=dir [specific_options] [-O] mount_point
Beispiel:
# mount -F cachefs -o backfstype=nfs,cachedir=/cache,demandconst
129.69.110.10:/raid /raid
chachfs – Verwaltung – II

Testen
– cfsadmin -l cache_directory - List file systems + statistics
– cachefsstat
- Cache File System statistics

Warten/Pflegen
– cachefspack [ -i| -p| -u] [-f pack-list] [-U cache-dir] [file]...

Prüfen der Konsistenz
– cfsadmin -s {mntpt1 ....} | all
geht nur, wenn mit der Option “demandconst” gemountet.
chachfs – Verwaltung - III

Löschen
– cfsadmin -d {cache_ID | all} cache_directory
Beispiel:
# umount /raid
# cfsadmin -d modsrv01.modus.uni-stuttgart.de:_raid:_raid /cache
(cache-id aus # cfsadmin -l cache-directory)
NFS - Literatur

Verwaltung von Unix- Netzwerken mit NFS und NIS.
(Hal Stern)
Taschenbuch (1995) OReilly/VVA; ISBN:
3930673258 Preis: DM 69,00

Linux-/Windows Integration mit NFS:
http://wwwab.fh-wedel.de/rechnernetze/projekte/nfs/
11. Network Information Service (NIS)
Verzeichnisdienste
Beispiel:
Telefonauskunft
?
Arten von Verzeichnisdiensten

Globale Verzeichnisdienste
– DNS
– X500 / LDAP

Lokale Verzeichnisdienste
– NIS (YP)
– NIS+
– /etc - Dateien
Auswahl von Verzeichnisdiensten
Syntax von /etc/nsswitch.conf
<database>: [files] [nis] [nisplus] [dns] [ldap] ...
Beispiel# cat /etc/nsswitch.conf
passwd:
group:
#
hosts:
networks:
protocols:
compat
files nis
- beachte “+” Eintrag in /etc/passwd
- kein “+” Eintrag in /etc/group
dns nis files
nis [NOTFOUND=return] files - "files" only if nis is down
nis [NOTFOUND=return] files - "files" only if nis is down
NIS – Verzeichnisdienste (Maps)
bootparams
group.bygid
hosts.byname
ethers.byaddr
group.byname
mail.aliases
ethers.byname
hosts.byaddr
mail.byaddr
netgroup.byhost
netid.byname
networks.byname
netgroup.byuser
netgroup
netmasks.byaddr
networks.byaddr
passwd.adjunct. byname
passwd.byname
protocols.bynumber
services.byservice
passwd.byuid
rpc.bynumber
ypservers
protocols.byname\
services.byname
NIS – Architektur
NIS-Domäne: “hell”
NIS-Domäne: “dunkel”
Master-Server
Master-Server
MapTransfer
MapTransfer
Slave-Server
Client
MapTransfer
Slave-Server
NIS-Requests
NIS-Requests
Client
Client
Client
Client
Slave-Server
NIS-Requests
Client
Client
Client
Client
NIS - Installation

NIS als Nameservice bei Solaris-Installation auswählen

Nachträglich installieren:
– SUNWypr
– SUNWypu
root-Teile von YP
usr-Teile von YP
Beispiel:
# cd /sunswsrv/cdrom_copies/Solaris_8/sol_8_sparc_2/Solaris_8/Product
# pkgadd –d .
# ... auswählen von SUNWypr und SUNWypu
Dateien, Verz. auf NIS-Master
Installation:
 /var/yp/Makefile
 /var/yp/binding/...
 /usr/bin/...
 /usr/lib/netsvc/yp/...
Map-Generierung
...ypservers
NIS-Befehle
spez. NIS-Befehle
Konfiguration:
 /var/yp/<domain>/...
 /var/yp/<source>/...
 /etc/defaultdomain
Maps
Quell-Dateien
Domänenname
NIS - Konfiguration
1.
Planung der NIS-Domäne
2.
Master-Server vorbereiten
Master-Server konfigurieren
NIS-Prozesse auf Master-Server starten
3.
4.
5.
6.
Slave-Server konfigurieren
NIS-Klienten konfigurieren
Planung der NIS-Domäne

Festlegung des Domänennamens
– Max. 256 Zeichen

Festlegung der Master-Server
– Üblich: 1 Master-Server / Domäne
– Möglich: 1 Master-Server / Map
Festlegung der Slave-Server
 Bestimmung der Klienten

Master-Server vorbereiten - I

Domäne setzen
# domainname <my-domain>
# domainname > /etc/defaultdomain

Pfad zu “make” gesetzt?
# set path=($path /usr/ccs/bin)

Verzeichnis für Quelldateien anlegen ($DIR)
# mkdir /var/yp/<src>

Verzeichnis für Kennwortdatei anlegen ($PWDIR)
# mkdir /var/yp/<pwdir>
Master-Server vorbereiten - II

Quelldateien für Map-Konvertierung vorbereiten
– Kopiere Quelldateien -> $DIR (NICHT /etc/mail/aliases)
– Kopiere /etc/passwd, /etc/shadow -> $PWDIR
– Kommentare, ... aus Quelldateien entfernen

Makefile anpassen
-
DIR= /var/yp/<src>
PWDIR= /var/yp/<pwdir>
all: passwd group ...
gewünschte Maps eintragen
Neueinträge für eigene (nicht-standard) Maps
passwd-Map mit shadow
Nachteil:
Zwei Dateien zu pflegen!
 nsswitch.conf - Eintrag:
– “passwd compat” oder “passwd files nis”

Kopieren der Originale:
– cp /etc/passwd $PWDIR
– cp /etc/shadow $PWDIR

Bereinigen der Kopien
– lokale Einträge (root!) entfernen

Eintrag NIS-Verweis (bei “compat”)
- “+” in /etc/passwd, /etc/shadow
passwd-Map ohne shadow

nsswitch.conf - Eintrag:
– “passwd compat” oder “passwd

files nis”
Konvertieren der Originale:
– > cut -d: -f1,2 /etc/shadow > /tmp/eins
– > cut -d: -f3- /etc/passwd > /tmp/zwei
– > paste -d: /tmp/eins /tmp/zwei > $PWDIR/passwd

Bereinigen der Kopien
– lokale Einträge (root!) entfernen

Eintrag NIS-Verweis (bei “compat”)
- “+” in /etc/passwd, /etc/shadow
Master-Server konfigurieren



Nameservice=lokal setzen (nsswitch.conf: “files”)
Slaveserver in /etc/hosts eintragen
/usr/sbin/ypinit –m
– Slaveserver?
– terminate at nonfatal error?
– destroy existing files in the /var/yp/<domainname>?
=> Ruft “make” auf

Nameservice=nis setzen (nsswitch.conf: “... nis”)
Master-Server starten/stoppen
Automatisch beim Booten / Shutdown:
 /etc/init.d/rpc [start | stop]
Aus Befehlszeile:
 /usr/lib/netsvc/yp/ypstart
 /usr/lib/netsvc/yp/ypstop
NIS-Prozesse

ypupdated
- changing NIS information
(MS)

yppasswdd
- modifying NIS password file (MS)

ypxfrd
- NIS Transfer Daemon
(MS)

ypserv
- NIS Server
(S)

ypbind
- NIS binder process
(C/S)
Änderungen der NIS-Quelldateien
Editieren der Quelldateien im YP-Verzeichnis:
bsp# vi /var/yp/src/passwd
Maps neu generieren (nach jeder Änderung!):
bsp# cd /var/yp
bsp# make [map]
Slave-Server konfigurieren

Domäne setzen
# domainname <my-domain>
# domainname > /etc/defaultdomain


NIS-Server in /etc/hosts eintragen
Client initialisieren
– /usr/sbin/ypinit –c

NIS-Restart
– /usr/lib/netsvc/yp/ypstop; /usr/lib/netsvc/yp/ypstart

/usr/sbin/ypinit –s <master-server>
Slave-Server synchronisieren

Manuell
– yppoll <map>
– ypxfr [options] <map>

Cron (SUN-Standard-Scripts in /usr/lib/netsvc/yp)
– ypxfr_1perday*
– ypxfr_1perhour*
– /ypxfr_2perday
NIS-Klienten konfigurieren

Domäne setzen
# domainname <my-domain>
# domainname > /etc/defaultdomain

NIS als Nameservice auswählen
nsswitch.conf

ypinit –c
Liste der Server eingeben.
(Wird in “/var/yp/binding/<domain>/ypservers” gespeichert)
Achtung:
NIS-Client wartet beim Booten bis sich ein NIS-Server meldet!!
NIS-Befehle

ypcat
- NIS-Maps ausgeben

ypwhich
- Name des NIS server ausgeben

domainname - anzeigen/setzen akt. domainname

ypset
- NIS-Server setzen
12. Benutzerverwaltung
Kommandos und Dateien
Dateien/Verzeichnisse
 /etc/passwd
 /etc/shadow
 /etc/group
 /etc/skel
 dot-Files
Kommandos



user{add | mod | del}
group{add | mod | del}
passwd
/etc/passwd
root : x : 0 : 1 : Super-User : / : /sbin/sh
1
2 3 4
5
6
7
[1] Benutzername (+[@netgrp1:x:::::])
[2] Platzhalter für Kennwort (/etc/shadow)
[3] UID
[4] GID
[5] Kommentar
[6] Heimverzeichnis
[7] Benutzershell (muß in /etc/shells eingetragen sein!)
/etc/shadow
root : 7sCkol9HVx : 11031 : : : : :
:
1
2
3
4 5 6 7 8 9
[1] Benutzername
[2] Verschlüsseltes Kennwort
[3] Letzte Änderung des Kennworts (Tage seit 1.1.70)
[4] minimale Zeit für unverändertes Kennwort
[5] maximale Zeit Tage der Kennwortgültigkeit
[6] Zeit vor Benutzerwarnung des Ablaufs
[7] Zeit für Accountsperrung bei Nichtbenutzung
[8] Account-Verfallsdatum
[9] - ungenutzt -
/etc/group
bspgroup : : 4711 : anna,otto
1
2
3
4
[1] Gruppenname
[2] Kennwort
[3] GID
[4] Gruppenmitglieder
NIS-Benutzer/Gruppen

Mehr Benutzer und Gruppen (von NIS)
=> Eintrag in /etc/nsswitch.conf:
passwd: compat => Eintrag “+” erlaubt
 group:
files nis

/etc/skel

Initialdateien des Benutzers
– Werden beim Anlegen ins Heimverzeichnis kopiert

Solaris-Standarddateien (Installation)
– local.cshrc, local.login, local.profile

Weitere dot-Files:
– .logout, .Xdefaults, .kshrc, .rhosts, .xinitrc, .project, …

Und Verzeichnisse:
– .dt, …
Benutzer

Anlegen
useradd [-c comment] [-d dir] [-e expire] [-f inactive] [-g group]
[ -G group [ , group...]] [ -m [-k skel_dir]] [ -u uid [-o]] [-s shell] login
example# useradd -c "O. Muster" -d /home/muster -g 77 -u 66 -m -s /bin/csh muster

Ändern
usermod [ -u uid [-o]] [-g group] [ -G group [ , group...]] [ -d dir [-m]] [-s shell]
[-c comment] [-l new_name] [-f inactive] [-e expire] login

Löschen
userdel [-r] login
Gruppen

Anlegen
groupadd [ -g gid [-o]]

Ändern
groupmod [ -g gid [-o]] [-n name]

Löschen
groupdel group
passwd

Repository (-r)
– passwd [ -r files| -r ldap| -r nis| -r nisplus] [name]

Lokale passwd-Datei (-r files)
–
–
–
–

passwd [ -r files] [-egh] [name]
passwd [ -r files] -s [-a]
passwd [ -r files] -s [name]
passwd [ -r files] [ -d| -l] [-f] [-n min] [-w warn] [-x max] name
/etc/nsswitch.conf
Wird untersucht um Standard-Repository festzulegen
Bsp: passwd: compat (==> files nis)
Disk-Quotas - I

Dateisystem für Quotas konfigurieren
– rq als mount-option in /etc/vfstab setzen
– # touch quotas (im obersten Verz. des Dateisystems)
– # chmod 600 quotas

Quotas für einzelnen Benutzer setzen
– # edquota username
“fs /home1 blocks (soft = 50, hard = 90) inodes (soft = 0, hard = 0)”

Quotas für mehrere Benutzer setzen
– # edquota -p bob mary john
Disk-Quotas - II

Konsistenzprüfung
– # quotacheck [-v] -a | filesystem

Quotas aktivieren
– # quotaon [-v] -a | filesystem ...

Quotas deaktivieren
– quotaoff [-v] -a | filesystem ...

Quotas für Benutzer anzeigen
– quota [ -v ] [ username ]

Quotas für Datesystem anzeigen
– repquota [-v] –a | filesystem ...
13. Netzwerkverwaltung
Netzwerkkonfiguration – I

/etc/nodename
Die Daten können von der
Installation noch richtig gesetzt sein
 /etc/hostname.interface
!!
Hostname oder IP-Adr. eintragen
Hostname eintragen

/etc/defaultrouter
Name oder IP-Adr. des Default-Routers eintragen

/etc/hosts
Name und IP-Adr. des Hosts und des Default-Routers eintragen

/etc/netmasks
Netzmaske eintragen

(reboot)
Netzwerkkonfiguration – II

ifconfig – (Interface-Konfig. ohne reboot)
ex# ifconfig hme0 inet 129.143.67.51
netmask 255.255.255.0
broadcast 129.143.67.255 up

route add – (Default-Router angeben)
ex# route add default 129.143.67.62 1
Internet services daemon - inetd
inetd startet weitere Daemons bei Bedarf
– Vorteile
Diese Daemons belegen nicht ständig Speicherplatz
 Man kann sehr leicht tcpwrapper einsetzen

– Nachteile
Daemon muß bei jeder neuen Verbindung neu gestartet
werden
 Initialisierung des Daemons kann lange dauern

Der inetd wird über /etc/inetd.conf konfiguriert.
/etc/inetd.conf
# inetd.conf This file describes the services that will be available
#
through the INETD TCP/IP super server. To re-configure
#
the running INETD process, edit this file, then send the
#
INETD process a SIGHUP signal.
# These are standard services.
ftp
stream tcp nowait root /usr/sbin/tcpd in.ftpd -l -a
telnet stream tcp nowait root /usr/sbin/tcpd in.telnetd
#
# Pop and imap mail services
pop-2 stream tcp nowait root /usr/sbin/tcpd ipop2d
pop-3 stream tcp nowait root /usr/sbin/tcpd ipop3d
imap stream tcp nowait root /usr/sbin/tcpd imapd
…
/etc/services
#ident "@(#)services 1.16 97/05/12 SMI" /* SVr4.0 1.8 */
#
# Network services, Internet style
#
Echo
7/tcp
echo
7/udp
...
ftp
21/tcp
telnet
23/tcp
smtp
25/tcp
mail
pop2
109/tcp
pop-2
# Post Office Protocol - V2
pop3
110/tcp
# Post Office Protocol - Version 3
pop-2
109/tcp
# Post Office
imap
143/tcp
imap2
# Internet Mail Access Protocol v2
...
Weitere Konigurationsdateien

/etc/ethers
- Ethernet address to hostname database
ex# cat /etc/ethers
cc:00:08:00:00:03 ex.rus.uni-stuttgart.de
00:a0:24:a9:29:de zsdsinz.rus.uni-stuttgart.de
…

/etc/resolv.conf - name server configuration
ex# cat /etc/resolv.conf
nameserver 129.69.1.28
nameserver 141.58.231.9
domain rus.uni-stuttgart.de
Netzwerküberwachung









netstat
route
traceroute
snoop
nslookup
ping
rpcinfo
ndd
arp
- show network status
- manipulate the routing tables
- print the route to a host
- capture and inspect network packets
- query name servers interactively
- send Echo-Request to network host
- report RPC information
- get and set driver parameters
- address resolution display and control
14. Systemdienste
Syslogd - log system messages

/etc/syslog.conf

Standars-Logs:
Konfigurationsdatei
– /var/adm/messages
– /var/log/*
{syslog|authlog}
– console
– Mail an root
cron – clock daemon

Führt Befehle zu vorbestimmten Zeiten aus

cron-Befehle:
– crontab –{e | l | r}

edit | list | remove
der crontab-Datei des Benutzers
cron-Dateien:
–
–
–
–
/etc/cron.d/cron.{allow|deny}zugelassene Benutzer
/etc/default/cron
cron-Defaults
/var/cron/log
cron-Log
/var/spool/cron/crontabs
crontabs der Benutzer
crontab - Format
33 08 * * * /u/rus/sinz/cmd/chk_adsm.sh > /dev/null 2>&1
1)
2)
3)
4)
5)
6)
minute (0-59),
hour (0-23),
day of the month (1-31),
month of the year (1-12),
day of the week (0-6 with 0=Sunday)
Auszuführender Befehl
15. Backup / Restore
Backup / Restore - Befehle



cp
tar
cpio

ufsdump
ufsrestore

TSM, siehe:






volcopy
dd
compress / uncompress
pack / unpack
gzip / gunzip
http://servwww.rus.uni-stuttgart.de/ZSDNEU/adsm/ADSM_main_text.html
TSM – Backup (Installation)

Software (tar-file) holen von:
ftp://ftp.rz.uni-karlsruhe.de
/pub/tsm/mirror/maintenance/client/.../LATEST/
tar -file ausgepacken
 Package installieren

# pkgadd -d <dir><package>
Auswahl: IBMadsm-c (Client).
TSM – Backup (Konfiguration)

dsm.opt anpassen:
– SErvername
– DOMAIN

rusadsm1
/
dsm.sys anpassen:
– SErvername
– TCPServeraddress
– NODename


Zu sichernde Verzeichnisse
rusadsm1
rusadsm1.rus.uni-stuttgart.de
INS_HOST
backup.excl anpassen (ausgeschl. Verzeichnisse)
Scheduler-Eintrag in /etc/inittab:
adsm::once:/opt/IBMadsm-c/dsmc sched >/dev/null 2>&1 &

Mail an [email protected]
TSM – Backup (Bedienung)

Aufruf Graphisches Werkzeug:
– dsm

Kommandozeile:
# dsmc
Backup Systemplatte

Single User Mode (wenn möglich)
# shutdown -g30 –y

Backup / auf Band
# ufsdump 0ucf /dev/rmt/0 /

(/usr, /opt, …)
Zurück in den Multi User Mode
– Cntrl+D
Restore Systemplatte
# mount /dev/dsk/c0t3d0s0 /mnt
(neue Platte)
# cd /mnt
# ufsrestore rvf /dev/rmt/0
# cd /
# umount /mnt
# installboot
\
/usr/platform/sun4m/lib/fs/ufs/bootblk
\
/dev/rdsk/c0t3d0s0
# init 6 (Reboot)
Notboot von Solaris
boot cdrom (im Monitor-Modus)
 Warten bis OpenWindows gestartet ist
(Systeminstallations-Fenster erscheint)
 Mausklick auf Workspace
 “Command Tool” öffnen
 => Kommandoausführung (ufsrestore, ….)

16. Serviceangebot von SUN

Sun Professional Services

Sun Support Services

Sun Educational Services
Sun Professional Services
IT-Architekturberatung
 Planung von unternehmensweiten
heterogenen Netzwerken
 Systemintegration und Implementierung von
kundenspezifischen Lösungen
 Projektmanagement,
Generalunternehmerschaft

Sun Support Services

SunSpectrum PLATIN - Mission-Critical Support

SunSpectrum GOLD - Business-Critical Support

SunSpectrum SILBER - System Support

SunSpectrum BRONZE - Self Support
SunSolve Service
Online Informationsdatenbank, zum Teil nur für Kunden mit
SunSpectrum-Servicevertrag [http://sunsolve.sun.de/]




Gezielte Suche oder Durchblättern der Information
Download von Patches
Zugriff auf diagnostische Werkzeuge
Automatisches Update von ausgewählten Dokumenten
(Auf CD-ROM, falls kein Internet-Anschluss vorhanden)
Sun Educational Services

Standard Trainings
– Solaris, Java, Netzwerke, Applikationen, … (bei SUN)

Indivduelle Firmen Trainings
– Standard- oder individuelle Inhalte vor Ort

Enterprise Consulting Services
– Management von Ausbildungsprojekten

Technology Based Training
– Lernsoftware, Online-Learning
17. Weitere Informationen
Internet-Adressen








http://sunswsrv.rus.uni-stuttgart.de/WSBetreuung_HomePage/SUN/
Mailliste: [email protected]>
http://sunsolve.sun.de
http://www.sun.de/
http://www.sun.com/{bigadmin|sysadmin}
http://docs.sun.com/
http://www.qunix.de
http://sunfreeware.com/
Bücher / Answerbook

Solaris 7 Systemadministration
– Handschuch, Thomas; Springer-Verlag Berlin Heidelberg (2000)

PDF-Dateien unter http://docs.sun.com

System Administration Guide, Volume 1 - 3
– Solaris Answerbook
http://sunswsrv.rus.uni-stuttgart.de:8888
System Administration Guide, Volume 1









"Managing Users and Groups Topics"
"Managing Server and Client Support Topics"
"Shutting Down and Booting a System Topics"
"Managing Removable Media Topics"
"Managing Software Topics"
"Managing Devices Topics"
"Managing Disks Topics"
"Managing File Systems Topics"
"Backing Up and Restoring Data Topics"
System Administration Guide, Volume 2
"Managing Printing Services Topics"
 "Working With Remote Systems Topics"
 "Managing Terminals and Modems"
 "Managing System Security Topics"
 "Managing System Resources Topics"
 "Managing System Performance Topics"
 "Troubleshooting Solaris Software Topics"

System Administration Guide, Volume 3
"Network Services Topics"
 "IP Address Management Topics"
 "Modem-Related Network Services"
 "Accessing Remote File Systems Topics"
 "Mail Services Topics"
 "Monitoring Network Services Topics"

Solaris - Systemadministration
Rechenzentrum
Universität
Stuttgart
[email protected]