Review Please turn in any homework/practicals you may have Folders Paths Services Processes.

Slides:



Advertisements
Similar presentations
Chapter 9 Part III Linux File System Administration
Advertisements

Some history PDP versions BSD/Version 7 split VAX virtual memory implementations End of line 4.4 BSD System V merges Modern versions OSF/1, Solaris, HPUX.
Booting and Shuting Down WeeSan Lee. Roadmap Bootstrapping Boot Loaders Startup/Init Scripts Reboot & Shutdown Q&A.
Genesis: from raw hardware to processes System booting sequence: how does a machine come into life.
Chapter 9: Understanding System Initialization The Complete Guide To Linux System Administration.
Booting and Shutting Down the UNIX Operating System Arcadio A. Sincero Jr. 6/6/2001 CMSC 691X, Section 6080.
Linux can be generally divided into four major components: 1. KERNEL – OS, ultimate boss The kernel is the core program that runs programs and manages.
Introduction to Unix – CS 21 Lecture 10. Lecture Overview Midterm questions Jobs and processes description The foreground and background Controlling jobs.
Linux Intro Linux, the do it yourself OS Linux, successor to MINIX Linux, Unix for the masses (PC users) History:
Starting and Stopping Linux. Boot Process BIOS initializes hardware –Loads the boot sector MBR loads the bootloader –Point to kernel Kernel initializes.
Processes & Daemons Chapter IV / Part III. Commands Internal commands: alias, cd, echo, pwd, time External commands, code is in a file: grep, ls, more.
System Startup and Shutdown
File System and Directory Structure in Linux. What is File System In a computer, a file system is the way in which files are named and where they are.
Configuring Disk Quotas Linux System Administration To implement disk quotas, use the following steps: Enable quotas per file system by modifying /etc/fstab.
Windows Basics: Desktop, Taskbar and Window
CIS 116SUNY Ulster Chapter L5 – The GUI Karl Wick.
Linux Filesystem Management
Thrive Installation.
Configuring the MagicInfo Pro Display
Booting and boot levels
Operating Systems Networking for Home and Small Businesses – Chapter 2 – Introduction To Networking.
Chapter 9 Part II Linux Command Line Access to Linux Authenticated login using a Linux account is required to access a Linux system. The Linux prompt will.
Guide to Linux Installation and Administration, 2e1 Chapter 3 Installing Linux.
System Startup & Shutdown Objectives –to interpret the Unix startup and shutdown configuration files –to be able to create a customised run level Contents.
Guide to Linux Installation and Administration, 2e1 Chapter 8 Basic Administration Tasks.
UNIX Startup and Shutdown CSCI N321 – System and Network Administration Copyright © 2000, 2010 by Scott Orr and the Trustees of Indiana University.
FTP Server and FTP Commands By Nanda Ganesan, Ph.D. © Nanda Ganesan, All Rights Reserved.
Installation Overview Lab#2 1Hanin Abdulrahman. Installing Ubuntu Linux is the process of copying operating system files from a CD, DVD, or USB flash.
1 Interface Two most common types of interfaces –SCSI: Small Computer Systems Interface (servers and high-performance desktops) –IDE/ATA: Integrated Drive.
SUSE Linux Enterprise Server Administration (Course 3037) Chapter 6 Manage Linux Processes and Services.
Quiz 15 minutes Open note, open book, open computer Finding the answer – working to get it – is what helps you learn I don’t care how you find the answer,
System Startup & Shutdown
UNIX (Linux) Introduction Module-1. OS Kernel In computing, the kernel is the central component of OS. It is a bridge between applications and the actual.
Hands On UNIX II Dorcas Muthoni. Processes A running instance of a program is called a "process" Identified by a numeric process id (pid)‏  unique while.
Agenda  Working with Processes: Purpose Running Programs within same process (execl, execlp, execle, execv, execvp, execve) “Spawning” other process (fork,
Linux Startup Process Presenter: Dipu Gupta.
Linux Security. Module 13 – Linux Security ♦ Overview Linux is more prone today to security loopholes and attacks, both inside and outside the network.
Sight Word List.
Homework & Practical Let’s go through it Does anyone not have access to the wiki? Questions?
Review Please hand in any homework and practicals Vim Scripting Inter-device communication.
Linux+ Guide to Linux Certification Chapter Six Linux Filesystem Administration.
UNIX Startup and Shutdown CSCI N321 – System and Network Administration Copyright © 2000, 2009 by Scott Orr and the Trustees of Indiana University.
PTA Linux Series Copyright Professional Training Academy, CSIS, University of Limerick, 2006 © Workshop VI Scheduling & Process Management Professional.
Lecture 02 File and File system. Topics Describe the layout of a Linux file system Display and set paths Describe the most important files, including.
Review Please turn in your homework and practicals Packages, installation, rpm command Apache – Quick and easy way to set up a web server to play around.
CSC414 “Introduction to UNIX/ Linux” Lecture 3
Sys Admin Course Service Management Fourie Joubert.
Agenda Managing Processes (Jobs) Command Grouping Running jobs in background (bg) Bringing jobs to foreground (fg), Background job status (jobs) Suspending.
Agenda The Bourne Shell – Part I Redirection ( >, >>,
Hands-On Microsoft Windows Server 2008 Chapter 7 Configuring and Managing Data Storage.
An Introduction to processes R Bigelow. A Unix Process A process in Unix is simple a program The Unix system is made up of a group of processes all interacting.
Lecture 4 & 5: System Architecture  File systems  Devices  File system permissions  Review of Linux runlevels  In-class exercise.
Advance startup options Shift Restart. Restart options.
Using Networks. Assignment Issues find syntax Permissions HW4 3c /proc vs /tmp vs /var.
Windows Server 2003 { First Steps and Administration} Benedikt Riedel MCSE + Messaging
Linux Filesystem Administration
Linux Introduction Linux was developed in the early 1990’s by Linus Torvald computer science student at the University of Helsinki Linux is distributed.
System Administration Startup Process. Why Care? ● Every process on your system comes about by following a specific chain of events from the machine startup.
Getting Started with Linux
Chapter Objectives In this chapter, you will learn:
Guide to Linux Installation and Administration, 2e
...looking a bit closer under the hood
Linux Commands Help HANDS ON TRAINING Author: Muhammad Laique
Hands On UNIX AfNOG 2010 Kigali, Rwanda
Linux Start Sequence Summary
Hands On UNIX AfNOG X Cairo, Egypt
Linux Filesystem Management
Creating a Simple Game in Scratch
Configuring Disk Quotas
Presentation transcript:

Review Please turn in any homework/practicals you may have Folders Paths Services Processes

Today Jobs IDs Backgrounding Runlevels Partitions HDDs

Process Actions (commands) executed on a server are processes A process is a specific task to be completed Simple as ‘run ls’ or complicated as ‘listen for TCP connection on port 80’ From the time the server/computer is booted, each task is given a number This is the ‘process ID’ Starts counting at 1 and increments as soon as a PID is assigned

System These all build to run our system One process runs the clock One process runs authentication One process runs logging One process runs a shell One process runs … Similarly grouped processes are ‘services’ Network: IP, port, protocol Web: data, specific port, specific protocol

Slow Processes We can run a process “in the background” Most of our commands have been quick Our scripts too But what about when they’re not quick? Timed Performance Testing ‘Burn-in’ SQL

Background Services run “behind” our shell, we can still type ~]# service network start Bringing up loopback interface[ OK ] ~]# Processes do not give shell back until they end If we know (or find out) something is going to take a while, we can run it ‘in the background’ while we do other stuff

Example Setup Setup: A script that has one major command line – sleep 100 This will take 100 seconds to execute, during which we will not have the shell Finally, it prints to STDOUT “done” 1) We can stop a script (or command) and run it in the background 2) We can start a script, pause it, and move it to the background

sleep_script.sh So what does it look like?

Move it to the Background So if I’ve run my sleep_script.sh, and I see it’s taking forever, I can move it to the background Press ctrl+z – this will stop the job and give me a shell back It will also tell me the ‘job number’ This is NOT process ID – this is job number Process ID (PID) is a unique number given by the system Job number (job) is relative to the shell and the number of jobs running in your user’s shell

Moving Pt 2 Job number is in [1] – this is job number 1 Also, it’s stopped/paused right now So we can use that to move it to the ‘background’ and restart it We use the bg command bg bg 1 Then we can use the fg command to get it back if we need to fg 1

Example ~]$./sleep_script.sh ^z [1]+ Stopped./sleep_script.sh # The above is ‘paused’ – still taking up resources, but not running/consuming more ~]$ bg 1 [1]+./sleep_script.sh & # Now it’s running again ~]$ fg 1./sleep_script.sh

Finishing If the job completes while in the background we get a nice message: ~]$ cd ~ [1]+ Done./sleep_script.sh (wd: ~) (wd now: ~) It told us it finished elsewhere Or, if we’ve pulled it back to the fg, our shell comes back ~]$ fg 1./sleep_script.sh ~]$

Starting in Bg ~]$./sleep_script.sh & [1] What is 21251? How do I check to see if we’re right on what is?

Starting in Bg 2 ~]$ ps -ef | grep -i sleep_script.sh student :59 tty1 /bin/bash./sleep_script.sh student :00 tty1 grep -i sleep_script.sh It’s the PID Now we can call it in bf/fg or kill/nice

Questions on Background?

Runlevels Control how many and which processes start on boot A way to reference the system state once the ‘default’ scripts have run 7 total Numbering starts at 0

Runlevels Listed 0 – Off 1 – Single User Mode 2 – Multi-User Mode (Limited) 3 – Multi-User Mode w/Networking 4 – Reserved 5 – GUI 6 – Reboot

0-1 Explained 0 – Off service network stop There are ‘stop’ scripts that tell them how to stop ‘gracefully’ Turn EVERYTHING off Runlevel 0 runs these ‘off’ scripts for the whole system 1 – Single User Mode ‘Recovery’ mode Only the ‘base’ for what is needed to boot You have to load other things yourself

Why I Hate Ubuntu (Pt 1) Runlevel 2 – Multi-user Mode Does not configure network (and other stuff) Oh, right, except for Ubuntu Runlevel 3 – Multi-user w/Networking Wikipedia: “Starts the system normally” We boot into runlevel 3 Runlevel 4 – Reserved Runlevel 5 – Runlevel 3 w/GUI Runlevel 6 – Reboot

What’s Going On? Switch levels through the ‘init’ command This will go through a reboot “Init” or initialization scripts set up how the system is configured Configured…config… Where do you think these scripts are located?

/etc/init.d The scripts in /etc/init.d are linked to the folders /etc/rc0.d /etc/rc1.d /etc/rc2.d /etc/rc3.d /etc/rc4.d /etc/rc5.d /etc/rc6.d Look familiar? The system calls each script in each folder a certain way

/etc/rc3.d (for example) Holds scripts starting with S and K S is ‘start’ script /etc/rc3.d/S08iptables K is ‘kill’ script /etc/rc3.d/K74ipsec Numbered S01sysstat-S99local Lower numbers are run first & case sensitive

Questions On Runlevels? Runlevels Set what automatically starts (or stops) 0-7 (8 total) Scripts are called in a certain way (shutdown vs kill)

One Last Note Partitions A ‘partition’ is a physical divider A Linux partition is a section of a physical hard drive (hdd) You set it for a physical maximum size, and the system can’t exceed that maximum What happens if all data is in one cup (say it’s dyed blue), and this firehose just blasts neon green at the cup What happens to the blue?

Record Player “I’m too old for this” – Danny Glover, Lethal Weapon This may be an ancient reference, but it holds up the best A record player Needle running across it (head) Data is song Tracks are sectors

Reference

Partitions 3 So we can think of partitions as the colored areas Yellow is our / partition, red is our /swap, blue is our /var, black is our /home, and white is our application (/opt or /var/www or….) Keep in mind that they all take up 2 circles, but the outside circles are bigger

Partitions The df command shows free space on our system To create a partition on a new hdd use fdisk –l #that’s a lowercase L

File Systems Table Use the mount command to set a drive for use mount /dev/ / mount /dev/sdc /nfsshare1

Why Best Practice Rocks Went to ‘DefCon’ with old IDS admins They missed over half the trip because they had to continuously deal with these failures I took over the IDS systems I demanded the vendor partition the system w/best practice (among other things) /var filled, system still ran I stopped waking up at 2am My last 6 months I had one device failure It was a hardware failure, not a system failure

Questions on Partitions df Show ‘disk file’ usage – how much room on which partitions fdisk -l /dev/sda Use fdisk tool to list partitions on that hard drive mount /dev/sda /mnt Make /dev/sda usable via the /mnt folder /etc/fstab File systems table – file that holds system partition info

Own Study Jobs Job IDs – Sobell, Intro (p60), more (p130), p323 Backgrounding – Sobell, Chapter 5 (p146) Job Control P294 Runlevels – Sobell, Startup Files (p278) Partitions & HDDs dditionalHardDrive.htmlhttp:// dditionalHardDrive.html