Download presentation
Presentation is loading. Please wait.
Published byOlivia Rodgers Modified over 7 years ago
1
ITEC400 Week 12 Instructor Professor Robert D’Andrea
2
Agenda Administrative Issues Link of the Week This Week’s Expected Outcomes Points of interest Moving around in UNIX Break-Out Problems Upcoming Deadlines Hands-on Information Lab Assistance, Questions, and Answers
3
Announcements Announcements No script logic for Lab Assignments 12-1 and The final exam dates are April 11 through April 16, 2016 (week 15).
4
Link of the week Domain name registration Web site
SCTWAod81M57A Determine if a domain is currently in use. Online success starts with a great domain. What is a domain name? A domain name (for instance, "example.com") is an identification string that defines a realm of administrative autonomy, authority, or control on the Internet. Domain names are formed by the rules and procedures of the Domain Name System (DNS). Any name registered in the DNS is a domain name.
5
Link of the week What is the function of the Domain Name System? The DNS translates Internet domain name and host names to IP addresses. DNS automatically converts the names we type in our Web browser address bar to the IP addresses of Web servers hosting those sites.
6
Link of the week What is the function of the Domain Name System? The Domain Name System (DNS) is a hierarchical distributed naming system for computers, services, or any resource connected to the Internet or a private network. It associates various information with domain names assigned to each of the participating entities. Most prominently, it translates easily memorized domain names to the numerical IP addresses needed for the purpose of locating computer services and devices worldwide. By providing a worldwide, distributed keyword-based redirection service, the Domain Name System is an essential component of the functionality of the Internet.
7
Link of the week BIND (Berkley Internet Name Domain) BIND is the most widely used DNS software on the Internet. On Unix-like operating systems it is the de facto standard. Originally written by four graduate students at the Computer Systems Research Group at the University of California, Berkeley (UCB), the name originates as an acronym from Berkeley Internet Name Domain, reflecting the application's use within UCB.
8
Link of the week What is meant by top level domain? A top-level domain (TLD) is one of the domains at the highest level in the hierarchical Domain Name System of the Internet. The top-level domain names are installed in the root zone of the name space. For all domains in lower levels, it is the last part of the domain name, that is, the last label of a fully qualified domain name (FQDN).
9
Link of the week Top Level Domain (TLD) gov – Government edu – Educational org – Other organizations ( often nonprofit) mil – Military com - Commercial business net – Network organizations ca – Canada th – Thailand
10
Link of the week
11
Link of the week Who owns the Internet root? The authoritative name servers that serve the DNS root zone, commonly known as the “root servers”, are a network of hundreds of servers in many countries around the world. They are configured in the DNS root zone as 13 named authorities, as named on the next slide.
12
Link of the week Who owns the Internet root? VeriSign, Inc. University of Southern California (ISI) Cogent Communications Internet Systems Consortium, Inc University of Maryland NASA (Ames Research Center) US Department of Defence (NIC) US Army (Research Lab) Netnod RIPE NCC ICANN WIDE Project
13
Link of the week Who owns the Internet root?
n&msa=0&msid= a30b2657ea61ea33&ll= , &spn = , &z=2&om=1&dg=featur e
14
Link of the week Who is ICANN? Today, the Internet Corporation for Assigned Names and Numbers (ICANN) is one of several managers of the top-level development and architecture for Internet domain name space. It authorizes domain name registrars, through which domain names may be registered and reassigned.
15
Link of the week Top level domain name The right-most label conveys the top-level domain; for example, the domain name belongs to the top-level domain com. The hierarchy of domains descends from the right to the left label in the name; each label to the left specifies a subdivision, or subdomain of the domain to the right. For example: the label example specifies a node example.com as a subdomain of the com domain, and www is a label to create a subdomain of example.com.
16
Link of the week IANA - Internet Assigned Numbers Authority The top-level domains (TLDs) such as com, net and org are the highest level of domain names of the Internet. Top-level domains form the DNS root zone of the hierarchical Domain Name System. Every domain name ends with a top-level domain label. Each country has an IOS (International Organization for Standardization) country code designated as its domain name.
17
Link of the week Hostname A hostname is a domain name that has at least one associated IP address. For example, the domain names and example.com are also hostnames, whereas the com is not a domain. However, other top-level domains, particularly country code top-level domains, may indeed have an IP address, and if so, they are also hostnames.
18
Link of the week Hostname Hostnames impose restrictions on the characters allowed in the corresponding domain name. A valid hostname is also a valid domain name, but a valid domain name may not necessarily be valid as a hostname.
19
This Week’s Expectated Outcome
Upon successful completion of this module, there should be a better understanding of : Sockets User initialization Crontab File System and disks Action words in /etc/inittab file
20
Sockets Sockets is based on a client/server model The Unix Domain Sockets is a socket that allows two-way communications. Unlike a pipe, which is used to communicate in one direction. One of the most common domains sockets communicate over is the Internet, but we won't discuss that here Sockets are communication points on the same or different computers to exchange data. Sockets are supported by Unix, Windows, Mac, and many other operating systems.
21
Sockets Sockets use system calls to the kernel to complete each level of connectivity.
22
Sockets
23
Sockets
24
Link of the week UNIX-like file systems UNIX-like file system is hierarchical. It is interpreted from left to right. The top-level domain name appears at the left end. /var/mail/dandrear The URL (Uniform Resource Locator) is also hierarchical. Its top-level domain name appears at the end, but is read from right to left. alpha.einstein.edu beta.ca.mail2web.com
25
UNIX Operating System User Initialization /etc/profile file is the basic setup for all users. The /etc/profile contains the environmental variables and commands used by most shell users. User preferred environmental set up $HOME/.profile $HOME/.bash_profile If the /etc/profile and .profile files are not present during the initialization, a prompt is still displayed. Use the ls –a command to display the .profile or .bash_profile file under your $HOME directory.
26
UNIX Operating System Metadata Metadata is data about data. It may describe a single piece of data or multiple content items and hierarchical levels. Example: Legacy card catalogs in a library. Metadata can be the name of a US corporation, or a registered trademark.
27
UNIX Operating System Metadata Metadata is structured information that describes and allows us to find, manage, control and understand other information. Structured metadata represents the specifications of this information. In this case, a better definition of this design concept would be "data about the containers of data".
28
UNIX Operating System Metadata There are many different types of metadata. Business Intelligence metadata General IT metadata IT metadata management products File system metadata Image metadata
29
UNIX Operating System /etc/inittab actions respawn – The process will be restarted whenever it terminates. wait – The process will be started once when the specific run level is entered. once – The process will be executed once when the specific run level is entered. boot – The process will be executed during system initialization. initdefault – This entry specifies the run level which should be entered after system boot. sysinit – The process will be executed during system boot. It will be executed before any boot or boot wait entries.
30
UNIX Operating System /etc/inittab Actions powerwait – The process will be executed when the power goes down. powerokwait – This process will be executed as soon as init process is informed that the power has been restored. powerfailnow – This process will be executed when the init process is informed that the battery of the external UPS power is failing. ctraltdel – The process is executed when the init process receives the SIGINT signal. This means that someone on the system console has pressed the Ctrl-Alt-Del key combination.
31
UNIX Operating System UNIX-like commands ps –s (view zombie processes) ps –e –o pid,ppid,stat (display all processes / listed fields) ps –aux (view status of all processes) ps –x (view only active processes) ls –a (view “.” processes) ps -aux | grep crond (view crond executing) nice (UNIX) (modified scheduling priority) (-20 to 19 range) If a user wanted to compress a large file, but not slow down other processes, they might run the following: nice -n 19 tar cvzf archive.tgz largefile
32
UNIX Operating System UNIX-like commands umask (displays umask numeric values) umask –S (displays umask symbolic values) fg (Continues a stopped job by running it in the foreground, some shells are not able to run this command). bg (Continues a stopped job in the background) cat /etc/shells (Display available shells on system). echo $SHELL (Display current shell being utilized). chsh –s /bin/ksh (Change to a different shell) printenv (command to display environment variables). df (report file system disk space)
33
UNIX Operating System Unix/Linux Processes Linux defines a unit of work as a task or process. UNIX defines a unit of work as a process. Each process is identified by a unique PID (Process ID). Each user is identified by a unique UID (User ID). Each group of users is uniquely identified by a GID (Group ID). Each process is started from a previous process using the fork and exec command. The init process is created by the kernel using a non-traditional procedure called hand-crafted or spontaneous.
34
UNIX Operating System Non-Inherited Parent Process Attributes File locks (semaphores) Child resource utilization is set to zero Pending signals (kill –l signal name) Daemon processes Offer services like web pages serving, transferring, time synchronization, and similar. They usually consume little CPU and memory, and run quietly without user interaction. They mainly communicate with other computer programs, or with other computers via network.
35
UNIX Operating System Linux Kernel Modules Hardware in Linux is handled by kernel drivers, many come from kernel modules. These are standard driver files, which are stored in the /lib/modules directory. Typically, Linux loads the needed modules at boot time.
36
UNIX Operating System Loading Kernel Modules Unix-like systems allow loading kernel modules with two programs: insmod and modprobe. The insmod program loads a module into the kernel. The process requires that you have already loaded modules on which you’re loading relies. The modprobe program automatically loads any dependent modules.
37
UNIX Operating System Loading Kernel Modules Examples: lnsmod /lib/modules/3.7.33/kernel/block/floppy.ko (extension is required) When executing the lnsmod program, if it fails during the download of floppy.ko, chances are some dependencies are needed. You can manually download the dependent modules or execute the modprobe program. modprobe floppy (extension not required) The –n or –dry-run option causes modprobe to perform checks and all other operations except the actual download.
38
UNIX Operating System Modules loaded on system using insmod command Module Size Used by af_packet too snd_cs46xx snd_pcm_oss snd_mixer_oss iptable_filter ip6_tables
39
UNIX Operating System Crontab Utilization Cron is the periodic event scheduler of your system. cron enables users to schedule jobs (commands or shell scripts) to run periodically at certain times or dates. It is commonly used to automate system maintenance or administration, though its general-purpose nature means that it can be used for other purposes, such as connecting to the Internet and downloading .
40
UNIX Operating System Crontab Utilization The following examples give you an idea of its usefulness and necessity: Regular daily backups Periodic mail checking Polling a device(s) for input Sending regular reports Sending user every time a cron function is performed
41
UNIX Operating System Crontab Utilization cron file locations /etc/crontab /etc/cron.deny /etc/cron.allow Typical directory configuration /etc/cron.d/hourly /etc/cron.d/daily /etc/cron.d/weekly /etc/cron.d/monthly
42
UNIX Operating System How frequent does crond execute on Unix-like systems? Crond executes every minute Disable To prevent messages from being sent to your mail account, create a record that contains the following syntax: * * * * * echo > trash_bin To cancel the redirection, enter the following: rm trash_bin If the output is not needed, the following syntax can be included: * * * * * echo “Hello Administrator” > /dev/null 2>&1 The /dev/null device is a special file that disregards all data written to it.
43
UNIX Operating System crontab restrictions If your name appears in the cron.allow file. If that files doesn’t exist, you can use crontab. If your name does not appear in the cron.deny file. If cron.deny exists and is empty, all users can use crontab. If neither file exists, only the root user can use crontab.
44
UNIX Operating System Samba The /etc/samba/smb.conf file controls most aspects of how Samba works and is divided into two sections. Each section begins with a line starts with an open bracket ([), includes text, and ends with a closed bracket (]).
45
UNIX Operating System [globals] Defines global parameters [printers] Defines printers [home] Defines shares in the homes directory Comments in the smb.conf can start with either a pound (#) or (;). # A private directory, usable only by Bob. ; [bobsdir] ; comment = Bob’s Service ; path = /usr/somewhere/in/space ; writeable = yes ; printable = no ; public = no
46
UNIX Operating System What is the functionality of Network File System (NFS)? It is a remote file system designed by Sun Microsystems, available on computers from most UNIX system vendors. It allows the server to share selected local directory hierarchies with client systems on heterogeneous network. Files on the remote computer (fileserver) appear as if they are present on the local system. The physical location of a file is irrelevant to an NFS user.
47
UNIX Operating System Network Services A variety of services available across a network NFS: Developed by Sun Micro Systems Runs on UNIX, DOS, Windows, VMS, and Linux Files on the remote computer appear as if they are present on the local system.
48
UNIX Operating System Network Services Server configuration - /etc/exports file is the main NFS configuration file and it consists of two columns: Column #1 - lists the directories of the network or DNS domains that can get access to the directories. Column #2 – lists NFS options in brackets. #/etc/exports/data /files *(ro,sync) /home /24 (rw,sync) /data/test *.my-site.com (rw,sync) /data/database /32 (rw,sync)
49
UNIX Operating System Network Services A variety of services available across a network NFS: Use the Linux chkconfig command to configure the required NFS daemons to start at boot. chkconfig provides a simple command-line tool for maintaining the /etc/rc[0-6].d directory hierarchy by relieving system administrators of the task of directly manipulating the numerous symbolic links in those directories.
50
UNIX Operating System Network Services A variety of services available across a network NFS: Use exportfs –a command when no directories have been exported to NFS. Use exports –r command when adding a shared directory to export only the new entries. Use the showmount –a command to list all currently exported directories. In the /etc/fstab file, add a similar entry: #/etc/fstab :/data/files /mnt/nfs nfs soft,nfssvers=2 o 2
51
UNIX Operating System Network Services Remote (rlogin) is a UNIX command that allows an authorized user to login to other UNIX machines (hosts) on a network and to interact as if the user were physically at the host computer. Once logged in to the host, the user can do anything that the host has given permission for such as read, edit, or delete files. SSH is a protocol that allows computers to communicate with each other over encrypted connections. An SSH client is used to log in to a remote machine (running an SSH server) and allows the execution of commands on that machine.
52
UNIX Operating System Is there an orphan process?
root ? :20:28 /sbin/init dandrear :26 pts/ :00:00 grep init root :13 ? :00:00 sshd: dandrear [priv] root :58 ? :00:00 sshd: dandrear [priv] root :18 ? :00:00 sshd: dandrear [priv] dandrear :26 pts/ :00:00 sort -r dandrear :26 pts/ :00:00 grep dandrear dandrear :26 pts/ :00:00 ps -ef dandrear :26 pts/ :00:00 /bin/ksh ./pid_ppid.sh dandrear dandrear :26 pts/ :00:00 client_ser dandrear :13 pts/ :00:00 -ksh dandrear :13 ? :00:00 sshd: dandrear :59 pts/ :00:00 -ksh dandrear :59 ? :00:00 sshd: dandrear :18 pts/ :00:00 -ksh dandrear :18 ? :00:00 sshd:
53
UNIX Operating System X-11 X-11 is the name of the window manager used for most UNIX and Linux operating systems. A window manager is software that interfaces the video, keyboard and mouse drivers together to allow the user to communicate with the computer via a GUI. X-11 is unique in the sense that it runs over a network connection, specifically over IP. This enables a remote user to use his or her local X- Windows environment to interact directly with the other computer’s window manager as if they were sitting on that machine.
54
UNIX Operating System X-11 X-11 uses a client-server model, where the window manager is the server, and the user is using various clients. Applications that can be run in the graphical user interface are often written to use the X-11 software libraries to enable them to be used remotely. This is one of the strengths and power of the Unix system. X-11 enables a remote system to treat your local computer, it’s screen, keyboard and mouse as just another set of terminal interface devices that use an X-11 driver to communicate with the X-Windows manager.
55
UNIX Operating System Disk and File System Structure Copy-on-Write It is an optimization strategy for multiple users can give the same pointer for a resource. The primary advantage is that if a caller never makes any modifications, no private copy is needed. This strategy is used in virtual memory operating systems pages in memory that might be modified by either the process or its copy are marked copy-on-write.
56
UNIX Operating System Disk and File System Structure It is an organization of data and metadata on a storage device. It is the methods and data structure that an operating system uses to keep track of files on a disk or partition; that is the way the files are organized on the disk. Think of a file system as a protocol. File systems give meaning to the data on a particular storage device.
57
UNIX Operating System
58
UNIX Operating System
59
UNIX Operating System UNIX base root file system tree structure /bin (commands) /dev (devices) /etc (system configuration/executables) /sbin (boot commands) /usr/sbin (administrative commands) /home (users home directories) /lib (shared libraries) /mnt (temporary mount directory) /opt (optional software) /proc (processes) /stand (boot-related files) /var (spooling)
60
UNIX Operating System lost+found directory The fsck utility is generally able to repair most system damage and the frequency with which you will find anything at all in your lost+found directories has slowed significantly If you have a system crash and the Linux file system checker (fsck) recovers corrupt files they are placed here.
61
UNIX Operating System Unix-like System Security
Security on UNIX-like systems has focused on the following areas: Files and directories umask PATH variable SELinux iptables TCP Wrapper chroot jail password authentication UNIX to UNIX commands One-way function
62
UNIX Operating System Disks versus File Systems Application(s) interface with file systems and not disks. Why? Because disks have shortcomings and are not responsible for data recovery. File systems must return the stored data to a consistent state after an unplanned system crash.
63
UNIX Operating System File System Data recovery Data loss Fsync system call The fsync() function requests that all data for the open file descriptor named by openFD is to be transferred to the storage device associated with the file described by openFD. The nature of the transfer is implementation-defined. The fsync() function shall not return until the system has completed that action or until an error is detected.
64
UNIX Operating System File System Track caching Shortcoming of track caching – the file system expects the data to be stable store. A system crash with data in the cache will not deliver the user application integrity that was promised. Ways to circumvent this shortcoming – use non-volatile memory and provide microcode restart after power failures.
65
UNIX Operating System The problem with using non-volatile memory and microcode to restart is the cost. This solution is the disk controller, but is rarely an option. Newer Disks Provide tag queuing – each request passed to the disk driver is assigned a unique number. Most disk controllers can accept at least 16 pending requests. In combination, the fsync() and tag queuing are combined. Tag queuing was first implemented in SCSI disks. Enabling both reliability and speed. ATA disks lacked tag queuing. Later ATA adopted a tag queuing but called it Tag Command Queuing (TCQ).
66
UNIX Operating System Serial ATA has a new definition called Native Command Queuing (NCQ) that has a bit set in the write command that tells the drive if it should report completion when media has been written or when cache has been hit. If the driver correctly sets this bit, then the disk will display the correct behavior. Disk Sector Size From 1950s to 2010 the disk sector size was 512. In 2010, the sector size was increased to 4,096. Problems associated with this retrofit Error rate per bit has risen, requiring the use of ever longer correction codes. The error code must have enough redundancy for each sector to handle a high correction rate even though most sectors will not require it.
67
UNIX Operating System Is the increase density worth the extra overhead? Sectors are 8 times larger, which eliminates 88% of the sector start and stop headers. You want to reduce the number of non-data bits on the disk. In effect, using 4,096 byte sectors doubles the amount of user data that can be stored on a given disk. Legacy File Systems The 4,096-byte sectors have to emulate the old 512-byte sector disks. This mode causes the disk to be at least 50% slower.
68
UNIX Operating System How to avoid the slowdown Files smaller than or equal to 512-bytes are accumulated (buffered) into a 4,096-byte block. Conclusion Your file system must know the type of disk technology to which they are running to ensure reliable data retrieval and performance. Use flash-memory technology!
72
UNIX Operating System Major and Minor Numbers To UNIX, everything is a file. To write to the hard disk, you write to a file. To read from the keyboard is to read from a file. To store backups on a tape device is to write to a file. Even to read from memory is to read from a file. If the file from which you are trying to read or to which you are trying to write is a "normal" file, the process is fairly easy to understand: the file is opened and you read or write data. If, however, the device you want to access is a special device file (also referred to as a device node), a fair bit of work needs to be done before the read or write operation can begin.
73
UNIX Operating System Major and Minor Numbers
One key aspect of understanding device files lies in the fact that different devices behave and react differently. There are no keys on a hard disk and no sectors on a keyboard, though you can read from both. The system, therefore, needs a mechanism whereby it can distinguish between the various types of devices and behave accordingly.
74
UNIX Operating System Major and Minor Numbers
To access a device accordingly, the operating system must be told what to do. Obviously, the manner in which the kernel accesses a hard disk will be different from the way it accesses a terminal. Both can be read from and written to, but that's about where the similarities end. To access each of these totally different kinds of devices, the kernel needs to know that they are, in fact, different.
75
UNIX Operating System Major and Minor Numbers Inside the kernel are functions for each of the devices the kernel is going to access. All the routines for a specific device are jointly referred to as the device driver. Each device on the system has its own device driver. Within each device driver are the functions that are used to access the device. For devices such as a hard disk or terminal, the system needs to be able to (among other things) open the device, write to the device, read from the device, and close the device. Therefore, the respective drivers will contain the routines needed to open, write to, read from, and close (among other things) those devices.
76
UNIX Operating System Major and Minor Numbers The kernel needs to be told how to access the device. Not only does the kernel need to be told what kind of device is being accessed but also any special information, such as the partition number if it's a hard disk or density if it's a floppy, for example. This is accomplished by the major number and minor number of that device.
77
UNIX Operating System Major and Minor Numbers The major number is actually the offset into the kernel's device driver table, which tells the kernel what kind of device it is (whether it is a hard disk or a serial terminal). The minor number tells the kernel special characteristics of the device to be accessed. For example, the second hard disk has a different minor number than the first. The COM1 port has a different minor number than the COM2 port, each partition on the primary IDE disk has a different minor device number, and so forth. So, for example, /dev/hda2, the second partition of the primary IDE disk has a major number of 3 and a minor number of 2.
78
UNIX Operating System Sar command displays Major and Minor Numbers sar -d 12:00:01 AM DEV 12:05:01 AM dev8-0 (Maj=8, Min=0) 12:05:01 AM dev253-0 (Maj=253, Min=0) 12:05:01 AM dev253-1 (Maj=253, Min=1)
79
UNIX Operating System Points of interest A USB can be a bit challenging for operating systems designed as a hot-pluggable device. The Linux kernel was not originally designed to handle this type of technology. The kernel relies on external utilities to help manage matters. Two tools are used to help manage USB devices: usbmgr and hotplug.
80
Moving Around in UNIX lsmod – is a program to show the status of modules in the Linux kernel. insmod – is a simple program to insert a module into the Linux Kernel modprobe – is a program to add and remove modules from the Linux Kernel lsusb - list USB devices
81
Moving Around in UNIX chkconfig - has five distinct functions: 1.Adding new services for management 2.Removing services from management 3.Listing the current startup information for services 4. Changing the startup information for services 5. Checking the startup state of a particular service.
82
Break-out problems 1. How often do the following two commands execute? # 1.1. This is a comment. * * * * * c:\tools\CheckForNewFiles.exe # 1.2. This is a comment. * * 3 * * c:\tests\backup.bat 2. Define: File System Super block 3. What application is BIND associated 4. What is the “lost+found” area considered on a Unix- like system? 5. Linux Virtual File System 6. One-Way Encryption or One-Way Function
83
Hands on information Lab Assignment 11-1,Knoppix File System due March 27, Lab Assignment 12-1, 12-2 Programming Assignment 2 /Archives due April 3, Lab Assignment 13-1Open Source presentation due April 5 and April 12, 2016 Lab Assignment 14-1 CGI Script April 16,
84
After class assistance
Questions Comments Concerns I am available after this Franklin Live session to discuss any problems and/or concerns regarding the lab assignments
85
Lab Assistance available by phone and/or email
Similar presentations
© 2025 SlidePlayer.com Inc.
All rights reserved.