Week Eleven Agenda. Announcements Link of the week Review week ten lab assignment Week ten expected outcomes Next lab assignment Break-out problems Upcoming deadlines Lab assistance. Link of the week. File System http://www.skillsheaven.com/linuxfil.php Define: File system
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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.
ext3 includes journaling capabilities to allow faster recovery after unexpected reboots.
Define file system with journaling :
A file system with journaling is based on the techniques used from real-time transaction processing. A transaction log is used to store transactions either in a designated file system location or on a separate disk partition.
As changes are made to the file system, metadata changes are recorded to the log and writing entries to the log are done prior to writing the actual buffers to disk.
Benefits of journaling
In the event of a system crash, the entries in the log file remain intact and are replayed. Maintaining this level of data integrity ensures that the file system is in a constant state.
Definition: Network Protocol is a standard procedure and format that two data communication devices must understand, accept and use in order to be able to communicate with each other.
A network protocol determines the following:
Field separators: Colon (:)
Permissions on Einstein:
-rw-r--r-- 1 root root 1636 Aug 16 10:37 /etc/passwd
Example of /etc/passwd file
The /etc/passwd file is considered the user database for the system.
The information contained in the /etc/passwd file is useful for applications running on the system to access.
In summary, the /etc/passwd file is located under the system configuration and executables directory. The /etc/passwd file is the system’s master list of information about user accounts.
Field separators: Colon (:)
Permissions on Einstein:
-r-------- 1 root root 1107 Sep 5 15:24 /etc/shadow (Permission denied)
In summary, the /etc/shadow file contains the encoded passwords and password settings. The /etc/shadow file contains all the guide lines that pertain to the administration of the password.
Field separators: Colon (:)
Permissions on Einstein:
-rw-r--r-- 1 root root 833 Aug 16 10:37 group
Most Unix-like systems impose a limit of 16 to 32 group memberships per user.
Linux utilizes the vigrcommand used to edit the /etc/group file.
In summary, the /etc/group file identifies a collection of users who generally share similar functions. These groupings are not limited to departments or project.
In summary, the /etc/gshadow file is utilized to store the /etc/group password.
/etc/passwd - user account information
/etc/shadow - secure user password information
/etc/group - group information
/etc/gshadow - secure group password information
User account files
The /etc/passwd, /etc/shadow, and /etc/group files are considered the most important files for storing user account and authentication information.
Command to add a user account
Command to remove a user account
Knoppix – deluser
Linux - userdel
Adding a user to a computer involves several steps before the user can actually log in and perform user operations.
Every user that intends to utilize a computer must first gain access to that system, then go through an initialization process found under the user’s home directory. The new user initialization process begins by reading and executing the commands and environmental variables found in the $HOME/.profile file. Normally, the .profile is run automatically when you log into the system and the user’s environment is set up silently. Once the user is granted access permission to the system, a shell is spawn to allow the user to interact with the system.
Display the ~dandrear/.profile
When adding a new user account to the system, the administrator assigns the username a user identification number (UID). The UID is used internally by the system to identify each user. Duplicating the UID causes the accounts to share an identity in the system.
& symbol represents the background process.
Once a background process is launched by a terminal session, the process becomes unattached to the terminal that launched it. Background processes are terminated with PID=n and typing kill -9 PID
Example: simple_script &
Once a foreground process is started, it remains in the foreground until it completes, because it remains attached to the terminal. Foreground process by typing Ctl-C or Ctl-Z
An autonomous process is one that is not started by the kernel.
The daemon processes are started as part of the boot process and run until the system is shut down.
The UNIX inetd daemon may start the telnetd to handle a telnet connection.
The UNIX inetddaemon may start the ftpd to handle an ftp connection.
One daemon may start another; the UNIX inetddaemonwill accept a network connection and then start another daemon to handle the connection, based on the type of connection. There are various processes in UNIX that are not owned by a user, but exist to provide services. These processes are often called "daemons.“
The inetdsuperserverruns continuously listening for network connections. This type of daemon is more susceptible to be system breaches.
The Linusxinetddaemon is a more secure replacement for the inetdsuperserver. The xinetdsuperserver listens for network connections. When a connection is made, it launches a specific daemon and forwards the data from the socket to the daemon’s standard input.
Basically, the xinetdsuperserver works on demand.
Single threaded process is when a process only performs one task.
Multi-threaded process is when a process can perform multiple tasks concurrently without extra overhead needed to create a new process. Word processor is a multi-threaded process.
The kernel is responsible for creating the init process. This creation is referred to as spontaneous and/or hand-crafted.
Processes go through various process states during their existence. These are transitory states managed by the operating system (OS). The specifics of these process states vary from one OS to another, as well as state names.
Linux Process states:
- Waiting(process scheduler - load from secondary storage to main memory)
- Running(after a process is assigned a processor by a short - term scheduler, context switch is performed)
- Stopped(The process has been stopped, usually by receiving a signal. A process that is being debugged can be in a stopped state)
- Zombie (This is a halted process for some reason. Still has a task_struct data structure)
Zombie process is a process that has completed execution but still has an entry in the process table, allowing the process that started it to read its exit status.
Locate a zombie process on cs.franklin.edu
Orphan process is a process whose parent process has terminated or finished.
This init script performs basic system configuration which includes setting the system clock, hostname, and keyboard mapping; setting up the swap partitions; checking the remaining file system for errors; and turning on the quota management.
This init script runs the scripts for the services that need to be started when you first bring the system up and that need to be started or stopped when the system foes from single user mode to multiuser mode and back down again.
This init directory contains shell rc scripts and run via symbolic links in the /etc/rc.d/rcn.d directories, where n is the runlevel the system is entering. The following scripts reside in this directory.
This file is executed after the init scripts. Commands can be placed in this file to customize the system. These commands are best suited to execute in the background and after the initialization process completes.
This directory contains scripts the start and stop during a specific run level. The following scripts execute during run level one (1):
K10cups K25sshd K50netdump K74nscd K86nfslock K91isdn S01sysstat
Notice the numbering from 00 to 99. This numbering provides positioning of a script within the whole scheme of execution.
Upon successful completion of this module, the student will be able to:
a) fork and execute
b) Initialization process
d) PS tool
HTML defines the structure and layout of a Web document by using a variety of tags and attributes.
The correct structure for an HTML document starts with(enter here what document is about) and ends with . All the information you'd like to include in your Web page fits in between the and tags.
Define: Common Gateway Interface (CGI)
It is a standard used for interfacing between applications with information servers (Web server).
Application: CGI scripts execute in real-time and their output is dynamic in content.
Scripts are designed to be executed from a Web daemon that will transmit information to another software facilitator (database engine), and receive the results back again and display them to the client.
Is a command that causes the shell to fork a new process, creating a duplicate of the shell process (subshell).
The new process attempts to exec the command. If the command is a binary executable program, like a compiled C program, exec succeeds and the system overlays the newly created sub-shell with the executable program.
Both commands are system calls that are executed by the operating system.
/etc/inittab describes which processes are started at boot-up and during normal operation. The /etc/inittab format: id:runlevels:action:process
# System initialization.
# Run mingetty in standard runlevels
# /etc/inittab run levels 0,1, 2, 3, 4, 5, and 6
# /etc/inittab run levels 2, and 3
- id is a unique sequence of 1-4 characters which identify an entry in /etc/inittab
- runlevel is a specific process level that action should be taken
- action describes which action should be performed
- process specifies which process to be executed.
respawn – The process will be restarted whenever it terminates.
wait – The process will be started once when the specific runlevel is entered and init will wait for its termination.
once – The process will be executed once when the specific runlevel is entered.
boot – The process will be executed during system initialization.
initdefault – This entry specifies the runlevel 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.
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.
/etc/init.d/rc.d/crond is started automatically started when entering multi-user runlevel. crond is a daemon that executes scheduled commands.
/etc/crontab file is a file which contains the schedule of entries to be run and at specified times.
# Einstein /etc/crontab entries
01 * * * * root run-parts /etc/cron.hourly
02 4 * * * root run-parts /etc/cron.daily
22 4 * * 0 root run-parts /etc/cron.weekly
42 4 1 * * root run-parts /etc/cron.monthly
* * * * * command to be executed
1 2 3 4 5
First *: min (0-59)
Second *: hour (0-23)
Third *: day of month (1-31)
Fourth *: month (1-12)
Fifth *: day of week (0-6) (Sunday=0)
Example: 40 18 * * * rm /export/home/someuser/*
crontab -e Edit crontab file
crontab –l Display your crontab file
crontab –r Remove your crontab file
crontab –v Display last time crontab was edited.
9) Unix commands:
Account/LDAP Script, 10-1 is due 3/22/09.
Process, 10-2 is due 3/22/09.
Programming Assignment 2, 12-1 is due 4/5/09.
Archives Exercise, 12-2 is due 4/5/09.
Programming Assignment 3, 14-1 is due 4/18/09.
Presentations for Public Domain/Open Source Lab Assignment 13-1 will be 4/6 and 4/13.
Final Exam, 15-1 will be administered 4/13 through 4/18.
Final Exam Outline will be posted on the Bulletin Board 3/29/09, two weeks prior to the final exam date. This outline will be considered a “living” document. I will add additional information to it up to one week prior to the exam. All additional information posted after the initial posting will be highlighted/indicated.