320 likes | 508 Views
Desktops, Servers, and Services. ICS 436 Dr. Farag Azzedin fazzedin@kfupm.edu.sa Phone #: 860-3431. Managing Duties. Who has sysadmin experience? Today Managing (lots of) desktops Loading, updating, configuring Managing servers Important to lots of people Managing services
E N D
Desktops, Servers, and Services ICS 436 Dr. Farag Azzedin fazzedin@kfupm.edu.sa Phone #: 860-3431
Managing Duties • Who has sysadmin experience? • Today • Managing (lots of) desktops • Loading, updating, configuring • Managing servers • Important to lots of people • Managing services • Reasons for most servers
Managing (lots of) Desktops • Three main tasks for workstations • Initial loading of system software and applications • Updating system software and applications • Configuring network parameters • Need to get all three right • Initial load must be consistent across machines • Updates must be quick • Network configuration best managed centrally • Solution is automation (for supported platforms)
Lots of desktops You really don't want to install, configure, and update lots of machines individually.
Machine Life-Cycle • A machine goes through some states in its life-cycle: • New • Clean • Configured • Unknown • Off
Machine Life Cycle • There are five states and many transitions • Need to plan for them • Computer is only usable in the configured state • Want to maximize useful time • Minimize useless time • Setup and recovery should be fast and efficient --> automation (manual processes are slow and error-prone) • Slow (minimize) entropy • Restrict root privileges • Control where changes can and are made (e.g., 3rd party apps) • Rebuilding & retiring may require moving data & apps
Initial OS and App Installation • Automation solves many problems • Saves time/money; reduces mistakes; ensures uniformity • Examples: Solaris JumpStart, RedHat KickStart, Windows AutoLoad, IRIS RoboInst • Cloning (ghosting, disk imaging) sometimes an option • Full automation much better than partial • Eliminate prompts in installation scripts • Can include automatically notifying people when complete • Partial automation better than none • Needs to be well-documented for consistency
Use your own installation • Don't trust the vendor's pre-installed OS • Adding apps to a truly clean installation can be easier • Their install image can change over time • You'll need to re-install eventually • Making your re-installation a different configuration • You want to be certain that you have everything (drivers, software, etc.) to re-install • You may not want or need their special applications and add-ons
After installing Windows, I... • Uninstall AOL, any other advertising • Install virus protection, firewall • Uninstall unwanted apps (MS Money, • MusicMatch Jukebox, etc.) • Install latest patches • Install wanted applications
Updating system and applications • Over time, people find • New bugs • New security holes • New applications • Updates can (and should) be automated, too • Example automation systems include Solaris AutoPatch, Windows SMS, and Linux package updaters like yum and apt
Differences for updates • Updates are performed on functioning machines • The machine is already deployed • Can't flood network • May not have physical access • Users of host will expect it to work after update • Must be extremely careful! Gradual deployment. • Host may not be in known state • Host may have live users (requiring downtime) • Host may be disconnected periodically • Host may dual-boot (long periods between updates)
Network Configuration • Network config different from install • Values vary by location, rather than OS+apps • Typical solution is to use DHCP • Eliminate time and manual error • By sysadmin or user (assigning himself an IP address and/or hostname) • More secure (only authorized systems get access) • Can assign a particular IP to an individual host • Centralized control makes updates and changes easier (e.g., new DNS server)
Managing Servers • Different from desktop? Yes! • May serve hundreds or many thousands of users • Requires reliability and high uptime • Requires tighter security • Often expected to last longer • Extra cost is amortized across users, life span
Managing Servers (cont.) • Servers typically have • Different OS configurations than desktops • Deployment within the data center • Maintenance contracts • Disk backup systems • Better remote access
Server Hardware • Buy server hardware for servers • More internal space • More CPU performance • High performance I/O (both disk and network) • More upgrade options • Rack mountable/optimized • Use vendors known for reliability • Your time is valuable
File • More about changing file ownership • Use recursive option –R #chown –R harvey /home/xyz • Use find command # find /home/xyz –print | xargs chown test • Change owner and group using chown #chown new-owner:new-group files Note: Some systems use “.” Instead of “:” • Change group owner #chgrp newgroup file BSD: non-root users of chgrp must be • The owner of the file and • A member of the new group to change
File • File protection • Protect from unwanted access • Allow access to people who need it • Command chmod • File Access Types
File • Setting file protection • Operator: +, -, = • chmod accessstring_list files • Access string has three parts: • Accessclasses operator accesstype • Access classes u, g, o, a • Access type: any combination of r,w,x • For example: #chmod g+w testfile • Recursive option: -R #chmod –R go-rwx /home/xyz • Read the mannual of chmod for more options • Access classes • User access (u) • Group access (g) • Other access (o) • Example • -rw-rw-r--
File • Specifying numeric file modes • Example: r-xr—r– is 544 • Specifying the default file mode • umask • Specify the inhibited access permission with a three digit numeric mode. • Example: if umask is 077 • 077 is 000 111 111 • No r,w,x for group and others. Possible rwx for owners.
File • How to recognize a File access problem • File ownership or protection problem • If root can do it, then … • Example • The temporary files with the same name created by a different users still exist • Application switched the group ownership behind the scene. • A administrator decided to protect /dev/null, which caused some editor stopping working.
File • Mapping Files to Disks - inode • Data structure • Created when initialize the disk – Max number • Typically, one inode for every 2 – 8Kbytes file storage • Information stored • User owner and group owner ID’s. • File type • Access modes • File creation, access and modification times • Inode modification time • Number of Links to the file • Size of the file • Disk addresses specifying/leading to • No file name in inode
Processes • What is a process? • A single program that is running in its own virtual address space. • Process type • Interactive program • Associated with a terminal session • Control on foreground and background • Batch processes • Not associated with any terminal • Submitted to a queue and run it later • UNIX provide the command batch, at • Daemons • Server processes • Often initiated at boot time • Run continuously while the system is up • Idle until a request arrives
Process • The life cycle of a process • Fork-and-exec • Inherit the env values from parent process • Example: Run a grep Init Init fork Pid 424 exec Pid 1 Getty Pid 424 exec login Pid 424 exec sh sh fork Pid 563 exec grep
Processes Controlling Process
Devices • Allow device I/O operations to look just like file I/O • Example: disk drives • Disk partitions • Root partition/system disk • Disk special files (partitions, modes) • Mounting a disk into the unix directory hierarchy • Mount /dev/disk0a /home • Naming conventions • On Digital Unix 4.0g, /dev/rrz5c • On HP-UX, /dev/rdsk/c2t4d0s0 • Where • c2: the controller numner • t4: driver number on the controller • d0: logical unit number for SCSI devices • S0: partition number on that drive
Devices • Example: Special files for Other devices
Devices • List the devices on a system • HP-UX: ioscan • Tru64 UNIX: hwmgr • Linux: scsiinfo, hdparm
The Unix Filesystem Layout • Common directories • / • Root directory • /bin • Executables for user commands and utilities. • Some files are links to file under /usr/bin • /dev • Device directory, may includes sub-dirs such as dsk, mnt, pts, etc. • /etc and /sbin • System configuration files and executables • Boot scripts • /etc/default • hold default parameter values for various commands • /home or /usr/users • /lost+found • Files marked as in use on disk, but not listed in any directory – found by fsck • There is a lost+found on every disk partition
The Unix Filesystem Layout • More about common directories • /mnt • Temporary mount directory • /proc • Designed to enable processes to be manipulabel using UNIX file accessing system calls. • Linux puts more files about system configuration • /tmp • Available to all users as a scratch directory. • Normally, one of the UNIX startup script will clear /tmp. • /usr • Subdirs for programs, share libraries, administrative commands • /var • Spooling and other volatile directories. • Print spooling, mail system, cron facility • Optional softwares • Log files • /stand on HP – kernel image • /kernel on Solaris – kernel image
The Unix Filesystem Layout • The /usr directory • /usr/bin • Command binary files and shell scripts • X system: /usr/bin/X11 • /usr/include • Include files *.h, C-language headerfiles • Operating system include file /usr/include/sys • /usr/lib • Standard C libraries for mathematics and I/O • /usr/local • By convention, /usr/local/bin holds file that were developed locally or retrieved from other sources.
The Unix Filesystem Layout • More about /usr directory • /usr/share • Shared among a group of networked systems for static data files, … • /usr/share/man • Manual pages • Subdir /usr/share/man/man# for every man section • /usr/ucb • Contains standard UNIX commands originally developed under BSD.
Readings • Read Chapter 7