1 / 50

Week Eight Agenda

Week Eight Agenda. Announcements Special on C Language Headers Link of the week Display inode information This week’s expected outcomes Next lab assignment Break-out problems Upcoming deadlines Lab assistance, questions and answers. Week Eight Agenda. Announcements:

ella
Télécharger la présentation

Week Eight Agenda

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Week Eight Agenda Announcements Special on C Language Headers Link of the week Display inode information This week’s expected outcomes Next lab assignment Break-out problems Upcoming deadlines Lab assistance, questions and answers

  2. Week Eight Agenda Announcements: Everyone should have a grade recorded for the midterm exam. If not, please email me. The final exam is worth 200 points. It covers more information and has more questions. The final exam is not compressive. Only about 5 - 6 percent of the material from the midterm exam will be on the final exam. Sign up for your open source topic and email me the week you would like to do your presentation on.

  3. Week Eight Agenda C Language Program Headers #include<stdio.h> int main () { printf (“Welcome to ITEC400”); return 0; } When the <> surround the characters, the information resides in a system area, standard library. If a file name is written “alpha.h”, the compiler would look in the current directory.

  4. Link of the week http://bhami.com/rosetta.html A Sys Admin's Universal Translator (ROSETTA STONE) OR   What do they call that in this world? TasksOSs Adm. GUI AIX File System A/UX Kernel FreeBSD Start up scripts HP-UX Create a file system Linux Mount CDROM NCR Unix Add software Open BSD Mac OS X

  5. Link of the week http://support.apple.com/kb/HT1148?viewlocale=en_US Software Installation Quick Assist for Mac OS X is a great toolbox that organizes and supports your software collection.

  6. Link of the week Open Source Projects http://sourceforge.net http://freshmeat.net Lab Assignment 13-1 Public Domain/Open Software Evaluation is due December 15, 2013. Requirements: APA Style format Cover sheet (course, instructor name, topic) Three typed pages of information (min) Reference page

  7. Link of the week Lab Assignment 13-1 Public Domain/Open Software Evaluation Bulletin Board: Open Source Presentation Sign Up No two presentations shall be the same. Lab assignment grade components. Paper: 0 – 75 points Presentation 0 – 25 points Presentation dates: December 9 (week 14) December 16 (week 15)

  8. Week Seven Question How can the inode attributes be displayed? There is a good deal of information about individual files on a UNIX system. One way to display this information is through a Perl script. The Perl stat command is used to access thirteen pieces of information about a file through a script. ($dev, $ino, $mode, $nlink, $uid, $gid, $rdev, $size, $atime, $mtime, $ctime, $blksize, $blocks) = stat ( $fileattributes);

  9. Week Seven Question $dev – device number of the filesystem (0) $ino – inode number (1) $mode – file mode (permissions) (2) $nlink – number hard links (3) $uid – user ID of file’s owner (4) $gid – group ID of file’s owner (5) $rdev – device identifier (6) $size – total size of file (7) $atime – last access time in seconds since epoch (8) $mtime – last modified time in seconds since epoch (9) $ctime – inode change time in seconds since epoch (10) $blksize – block size for file syatem (I/O) (11) $blocks – actual number of blocks allocated (12)

  10. Week Seven Question Single file attribute (permissions): $mode=(stat($fileattributes))[2]; Single file attribute (date) and print: @date=stat ($fileattrabutes); print “$date[4]\n”; Perl module : use File::stat

  11. Review week seven lab assignment Define: Data structure is where information is stored/collected in one place. The stored information may or may not be related. Data structures are unique in their construction so as to deliver a specific usage. Commonly data structures are arrays, hash tables, stacks, and queues.

  12. Review week seven lab assignment The inode data structure. Use ls –i command to display attributes. file mode – file permissions (rwx) count of hard links – how many hard links point to the inode file type – executable, block special owner id group id time of last file access - timestamp time of last file modification - timestamp file size - bytes file addresses – addresses of the blocks of storage containing the files data on a HDD

  13. Review week seven lab assignment

  14. Review week seven lab assignment • The directory maps file names to inodes. • Each file has one inode. • The number of inodes is a kernel parameter value set manually or dynamically by the operating system. • Each file may have more than one directory entry. • Inodes contain a list of disk block addresses. • All inodes are data structures

  15. Review week seven lab assignment

  16. Review week seven lab assignment • When there are multiple hard links, more directory entries point to the same inode or file name. • An inode can only hold a fixed number of direct data block addresses (10 for Linux). Large files use indirect block addresses. • The inode keeps a count of the number of hard links that point to it. • Deleting a file deletes an entry from a directory. • If the number of hard links is 1, removing or deleting this file will also delete the inode.

  17. Review week seven lab assignment Define: A physical link (hard) refers to the specific location of physical data. Command: ln <original file name> <new file name> ln test_file_1 test_file_1_hard_link -rwx------ 2 dandrear faculty 20 Oct 21 11:37 test_file_1 -rwx------ 2 dandrear faculty 20 Oct 21 11:37 test_file_1_hard_link

  18. Review week seven lab assignment

  19. Review week seven lab assignment Define: A symbolic link is a link to a directory or to a file in a different file system. A symbolic path indicates the abstract location of another file. Command: ln –s <original file name> <new file name> ln –s test.txt test_symbolic_link -rwx------ 1 dandrear faculty 20 Sep 4 16:44 test.txt lrwxrwxrwx 1 dandrear faculty 8 Oct 18 19:31 test_symbolic_link -> test.txt

  20. Review week seven lab assignment Define: tar tar –cf newpack.tar /export/home/dandrear tar –xvf origpack.tar tar –tvf origpack.tar To automatically compress the tar file as it is being created, add the z flag, like this: tar -cvzfalldocs.tar.gz *.doc In this example, I added the .gz suffix to the archive file name, because the z flag tells tar to use the same compression as the gzip command.

  21. Review week seven lab assignment Define: gzip gzip filename.tar gzip –d filename.tar.gz gunzip filename.tar.gz Define: bzip2/bunzip2ip bzip2 filename.tar bunzip2 filename.tar.bx2

  22. Review week seven lab assignment Installing the software package Package FreeBSD Port Usually, the source files are packaged in a compressed archive file (.tar.gz). After downloading, the .tar.gz file, use the tar tool to uncompress the un-package the source files.

  23. Review week seven lab assignment Definition: Installation of computer programs. Installation process: - Condensed package - Unpack package - Customize package - Test the functionality of the system - Configure files

  24. Review week seven lab assignment Two choices for installing a project 1. Install binaries from a package called “rpm” in Red Hat. rpm checks for dependencies and conflicts with other installed packages on the system.

  25. Review week seven lab assignment To install or upgrade an rpm file or package you need to use the rpm command. RPM is a RPM Package Manager (originally called Red Hat Package Manager). Both Novell Suse Linux and Red Hat Linux support (Fedora Linux) uses rpm. To install an rpm: # rpm -ivhpackage.rpm To upgrade an rpm: # rpm -Uvhpackage.rpm Red Hat enterprise Linux user can use up2date command to install or update package over Internet: # up2date -i package-name

  26. Review week seven lab assignment The RPM Package Manager (RPM) is a powerful command line driven package management system capable of installing, uninstalling, verifying, querying, and updating computer software packages. Each software package consists of an archive of files along with information about the package like its version, a description, and the like. There is also a library API, permitting advanced developers to manage such transactions from programming languages such as C or Python.

  27. Review week seven lab assignment rpm is a tool rpm –q sloccount (query to see if tool exists) If the tool isn’t on your system, create a directory named sloccount Download name sloccount-2.23- 1.i386.rpm rpm –vUh sloccount-2.23-1.i386.rpm (install tool) See the man page regarding the rpm tool

  28. Review week seven lab assignment Red Hat enterprise Linux user can use up2date command to install or update package over Internet: # up2date -i package-name Fedora Linux user, use yum command to install or update package over Internet: # yum install package Fedora Linux Update package: # yum update package

  29. Review week seven lab assignment 2. Install from source code Allows for custom installations Allows for code modifications Optimum compilation for target platform Before you start to install source code on a system, it is best to understand in a general form what is involved in building software from source code, and to do some preparatory organization.

  30. Review week seven lab assignment First, a script will analyze your system, check that all the necessary software is installed for the compilation to succeed, and sometimes configure optional facets of the compilation process. Second, the code will actually be compiled.

  31. Review week seven lab assignment Third, the compiled application, libraries and support files will be copied to the appropriate directories on your system for all users to be able to access them. In the case of very simple software, the first step may not be used; also, some applications are designed so that you can run them without performing the third step.

  32. Review week seven lab assignment QUERYING AND VERIFYING PACKAGES: rpm {-q|--query} [select-options] [query-options] rpm {-V|--verify} [select-options] [verify-options] rpm --import PUBKEY ... rpm {-K|--checksig} [--nosignature] [--nodigest] PACKAGE_FILE ... INSTALLING, UPGRADING, AND REMOVING PACKAGES: rpm {-i|--install} [install-options] PACKAGE_FILE ... rpm {-U|--upgrade} [install-options] PACKAGE_FILE ... rpm {-F|--freshen} [install-options] PACKAGE_FILE ... rpm {-e|--erase} [--allmatches] [--nodeps] [--noscripts] [--notriggers] [--repackage] [--test] PACKAGE_NAME ...

  33. Review week seven lab assignment Software Installation of UNIX/Linux typically go something like this: • Download the software, which might be distributed in source code format, or as a binary. • Unpack the software from its distribution format (typically a tarball compressed with compress, gzip, or bzip2 • Locate the documentation (perhaps an INSTALL or README file, or some files in a doc/ subdirectory) and read up on how to install the software. • If the software was distributed in source format, compile it. This may involve editing a makefile, or running a configure script, and other work. • Test and install the software.

  34. Review week seven lab assignment Software releases Interfaces – normally remain the constant. Implementations – actual fixes Behaviors – system changes from one implementation to another

  35. Review week seven lab assignment Kernel is the central component of most operating systems. It’s responsibility is to manage the system’s resources and communicate between the hardware and software. Kernel space is allocated for the kernel. Users aren’t able to access this area. Kernel space is generally larger than user space. User space is a memory area where all user mode applications are performed. This memory area is swappable if necessary.

  36. Review week seven lab assignment UNIX/Linux Turnable Parameters Number of users on a system Maximum database size Number of global buffers Number of semaphores (e.g. train track) Set shared memory allocation Display: Kernel Tunable Parameters are located under the /proc/sys directory.

  37. Review week seven lab assignment Buffer cache Amount of memory used to transfer a file system data structure such as inodes, direct blocks, indirect blocks, and cylinder groups. Initially, you want to set up the buffer cache large enough to handle an inode data structure.

  38. Week eighth expected outcomes Upon successful completion of this module (weeks 6, 7, and 8), the student will be able to: • Create make file scripts for software programs. • Use pattern rules in makefiles. • Create an effective PowerPoint presentation. • Create make files with multiple targets. • Install software packages on a server.

  39. Next Lab Assignment fsck fsck is used to check and optionally repair one or more Linux file systems. If no filesystems are specified on the command line, and the -A option is not specified, fsck will default to checking filesystems in /etc/fstab serial. fsck –A command will do the following: Walk through the /etc/fstab file and tries to check all file systems in one run. This option is typically used by the /etc/rc system initialization file, instead of trying to use multiple commands for checking a single file system.

  40. Next Lab Assignment The exit code returned by fsck is the sum of the following conditions: 0 - No errors 1 - File system errors corrected 2 - System should be rebooted 4 - File system errors left uncorrected 8 - Operational error 16 - Usage or syntax error 32 - fsck canceled by user request 128 - Shared library error

  41. Next Lab Assignment /etc/fstab /dev/mapper/vg_system-root / ext4 defaults 1 1 UUID=5a9e44d8-7554-4d9d-bf16-a1b6cf48ff9e /boot ext4 defaults 1 2 /dev/mapper/vg_system-home /home ext4 defaults 1 2 /dev/mapper/vg_system-tmp /tmp ext4 defaults 1 2 /dev/mapper/vg_system-usr /usr ext4 defaults 1 2 /dev/mapper/vg_system-var /var ext4 defaults 1 2 /dev/mapper/vg_system-swap swap swap defaults 1 2 /dev/shm tmpfs defaults 0 0 devpts /dev/pts devpts gid=5,mode=620 0 0 sysfs /sys sysfs defaults 0 0 proc /proc proc defaults 0 0 dc2prst001.students.qw.franklin.edu:/vol/dc2_einstein_home/home /home nfs defaults 0 0

  42. Next Lab Assignment /etc/sysconfig Directory The /etc/sysconfig directory is where many of the files that control the system configuration are stored. This section lists these files and many of the optional values in the files used to make system changes.

  43. Next Lab Assignment /etc/sysconfig authconfig gpm ip6tables-config netdump_id_dsa rawdevices autofs grub iptables-config netdump_id_dsa.pub rhn clock harddisks irqbalance apm-scripts devlabel.d installinfo netdump prelink network sendmail console hwconf keyboard networking syslog crond i18n kudzu network-scripts sysstat devlabel init mouse ntpd xinetd

  44. Next Lab Assignment The Installation Exercise is an exercise that requires following directions. Perform each step in the prescribed sequence and using the installation syntax from this slide presentation. Create an ASCII file named 4th_log.txt Create the following directory /$HOME/itec400/homework/4th Download the programming language “forth” Copy compressed “tar” file to your 4th directory cd /$HOME/itec400/homework/4th cp ~dandrear/public_html/itec400/Misc/4th-3.3d2-unix.tar.gz . The expected output is an executable file called “4th”.

  45. Next Lab Assignment Grading Criteria The size of the file “readme.txt” is recorded in “4th_log.txt” : 0 – 15 points The prerequisites for the target ‘4th’ are recorded in “4th_log.txt”: 0 – 15 points The size of the executable named “4th”, in bytes, is recorded in “4th_log.txt”: 0 – 20 points

  46. Next Lab Assignment Demonstrate Power Point Presentation Summer 2013 Online Unix System Administration Wireshark PDF Creator Password Safe

  47. Break-out problems 1. Process ID 2. User ID 3. fsck 4. /etc/fstab 5. Turnable parameters 6. Multiuser runlevel (Linux) 7. /boot/vmlinuz-* 8. Single user mode 9. /var/mail/dandrear 10. inode 11. ASCII 12. crond 13. shared memory 14. semaphore 15. /etc/sysconfig 16. /proc directory 17. UTC

  48. Upcoming deadlines • Lab Assignment 8-1, Installation Exercise due November 10, 2013. • Lab Assignment 9-1, Startup/Shutdown due November 17, 2013. • Final exam can be taken from December 16 through 18, 2013. • Read Module 4 for week 8.

  49. Questions and answers • Questions • Comments • Concerns • I am available after this Franklin Live session to discuss any problems and/or concerns regarding the lab assignments

More Related