Unit 5 OS LINUX Case Study RGPV
Unit 5 OS LINUX Case Study RGPV
[www.sirtbhopal.ac.in]
Semester
IV
Subject Code
CS-405
Subject Name
Operating System
Unit-5
As Per
RAJIV GANDHI PROUDYOGIKI VISHWAVIDYALAYA, BHOPAL
(www.rgpv.ac.in)
New Scheme Based on AICTE Flexible Curricula
Computer Science and Engineering
By
Mayank Namdev
Asst Prof.
Department of Computer Science and Engineering
SAGAR INSTITUTE OF RESEARCH AND TECHNOLOGY BHOPAL
SAGAR INSTITUTE OF RESEARCH AND TECHNOLOGY BHOPAL
[www.sirtbhopal.ac.in]
CASE STUDY-LINUX
The Linux System
An operating system is a program that acts as an interface between the user and the computer hardware and
controls the execution of all kinds of programs. The Linux open source operating system, or Linux OS, is a
freely distributable, cross-platform operating system based on UNIX.
The Linux consist of a kernel and some system programs. There are also some application programs for
doing work. The kernel is the heart of the operating system which provides a set of tools that are used by
system calls.
The defining component of Linux is the Linux kernel, an operating system kernel first released on 5
October 1991 by Linus Torvalds.
A Linux-based system is a modular Unix-like operating system. It derives much of its basic design from
principles established in UNIX. Such a system uses a monolithic kernel which handles process control,
networking, and peripheral and file system access.
Important features of Linux Operating System
Portable - Portability means software can work on different types of hardware in same way. Linux
kernel and application programs supports their installation on any kind of hardware platform.
Open Source - Linux source code is freely available and it is community-based development project.
Multi-User & Multiprogramming - Linux is a multiuser system where multiple users can access system
resources like memory/ ram/ application programs at same time. Linux is a multiprogramming system
means multiple applications can run at same time.
Hierarchical File System - Linux provides a standard file structure in which system files/ user files are
arranged.
Shell - Linux provides a special interpreter program which can be used to execute commands of the
operating system.
Security - Linux provides user security using authentication features like password protection/
controlled access to specific files/ encryption of data.
Components of Linux System: -Linux Operating System has primarily three components
Kernel - Kernel is the core part of Linux. It is responsible for all major activities of this operating system. It is
consisting of various modules and it interacts directly with the underlying hardware. Kernel provides the
required abstraction to hide low level hardware details to system or application programs.
System Library - System libraries are special functions or programs using which application programs or
system utilities accesses Kernel's features. These libraries implement most of the functionalities of the
operating system and do not requires kernel module's code access rights.
System Utility - System Utility programs are responsible to do specialized, individual level tasks
By
Mayank Namdev
Asst Prof.
Department of Computer Science and Engineering
SAGAR INSTITUTE OF RESEARCH AND TECHNOLOGY BHOPAL
SAGAR INSTITUTE OF RESEARCH AND TECHNOLOGY BHOPAL
[www.sirtbhopal.ac.in]
By
Mayank Namdev
Asst Prof.
Department of Computer Science and Engineering
SAGAR INSTITUTE OF RESEARCH AND TECHNOLOGY BHOPAL
SAGAR INSTITUTE OF RESEARCH AND TECHNOLOGY BHOPAL
[www.sirtbhopal.ac.in]
Modes of operation
Kernel Mode:
ƒ Kernel component code executes in a special privileged mode called kernel mode with full
access to all resources of the computer.
ƒ This code represents a single process, executes in single address space and do not require any
context switch and hence is very efficient and fast.
ƒ Kernel runs each process and provides system services to processes, provides protected access to
hardware to processes.
User Mode:
ƒ The system programs use the tools provided by the kernel to implement the various services required
from an operating system. System programs, and all other programs, run `on top of the kernel', in
what is called the user mode.
ƒ Support code which is not required to run in kernel mode is in System Library.
ƒ User programs and other system programs work in User Mode which has no access to system
hardware and kernel code.
ƒ User programs/ utilities use System libraries to access Kernel functions to get system's low-
level tasks.
Major Services provided by LINUX System
Initialization (init)
The single most important service in a LINUX system is provided by init program. The
init is started as the first process of every LINUX system, as the last thing the kernel does when it
boots. When init starts, it continues the boot process by doing various startup chores (checking and
mounting file systems, starting daemons, etc).
Logins from terminals (getty)
Logins from terminals (via serial lines) and the console are provided by the getty program.
init starts a separate instance of getty for each terminal upon which logins are to be allowed. Getty
reads the username and runs the login program, which reads the password. If the username and
password are correct, login runs the shell.
Logging and Auditing (syslog)
The kernel and many system programs produce error, warning, and other messages. It is
often important that these messages can be viewed later, so they should be written to a file. The
program doing this logging operation is known as syslog.
Periodic command execution (cron & at)
Both users and system administrators often need to run commands periodically. For
example, the system administrator might want to run a command to clean the directories with
temporary files from old files, to keep the disks from filling up, since not all programs clean up
after themselves correctly.
o The cron service is set up to do this. Each user can have a crontab file, where the lists the
commands wish to execute and the times they should be executed.
o The at service is similar to cron, but it is once only: the command is executed at the
given time, but it is not repeated.
Graphical user interface
o UNIX and Linux don't incorporate the user interface into the kernel; instead, they let it be
implemented by user level programs. This applies for both text mode and graphical
By
Mayank Namdev
Asst Prof.
Department of Computer Science and Engineering
SAGAR INSTITUTE OF RESEARCH AND TECHNOLOGY BHOPAL
SAGAR INSTITUTE OF RESEARCH AND TECHNOLOGY BHOPAL
[www.sirtbhopal.ac.in]
By
Mayank Namdev
Asst Prof.
Department of Computer Science and Engineering
SAGAR INSTITUTE OF RESEARCH AND TECHNOLOGY BHOPAL
SAGAR INSTITUTE OF RESEARCH AND TECHNOLOGY BHOPAL
[www.sirtbhopal.ac.in]
SYSTEM ADMINISTRATOR
A system administrator is a person who is responsible for the configuration and reliable
operation of computer systems, especially multi-user computers, such as servers.
The system administrator seeks to ensure that the uptime, performance, resources, and
security of the computers without exceeding the budget.
To meet these needs, a system administrator may acquire, install, or upgrade computer components
and software, provide routine automation, maintain security policies AND troubleshoot.
Responsibilities of a System Administrator
A system administrator's responsibilities might include:
Installing and configuring new hardware and software.
Applying operating system updates, patches, and configuration changes.
Analyzing system logs and identifying potential issues with computer systems.
Introducing and integrating new technologies into existing data center environments and
configuring, adding, and deleting file systems.
Performing routine audit of systems and software.
Adding, removing, or updating user account information, resetting passwords, etc.
Responsibility for security and documenting the configuration of the system.
Troubleshooting any reported problems.
System performance tuning.
Various System Administrator Roles
In a larger company, these may all be separate positions within a computer support or
Information Services (IS) department. In a smaller group they may be shared by a few sysadmins, or
even a single person.
A database administrator (DBA) maintains a database system, and is responsible for the
integrity of the data and the efficiency and performance of the system.
A network administrator maintains network infrastructure such as switches and routers, and
diagnoses problems with these or with the behaviour of network-attached computers.
A security administrator is a specialist in computer and network security, including the
administration of security devices such as firewalls, as well as consulting on general security
measures.
A web administrator maintains web server services (such as Apache or IIS) that allow for internal
or external access to web sites. Tasks include managing multiple sites, administering security, and
configuring necessary components and software.
A computer operator performs routine maintenance and upkeep, such as changing backup
tapes or replacing failed drives in a redundant array of independent disks (RAID).
A postmaster administers a mail server.
A Storage Administrator (SAN) can create, provision, add or remove Storage to/from Computer
systems. Storage can be attached locally to the system or from a storage area network (SAN) or
network-attached storage (NAS).
Requirements for LINUX system administrator
1. While specific knowledge is a boon, system administrator should possess basic knowledge about all
aspects of Linux. For example, a little knowledge about Solaris, BSD, nginx or various flavors of Linux.
2. Knowledge in at least one of the upper tier scripting language such as Python, Perl, Ruby or more.
3. To be a system administrator, he/she at least needs to have some hands-on experience of system
management, system setup and managing Linux or Solaris based servers as well as configuring them.
4. Knowledge in shell programming such as Buorne or Korn and architecture.
5. Knowledge about storage technologies like FC, NFS or iSCSI is great, while knowledge regarding
backup technologies is a must for a system administrator.
6. Knowledge in testing methodologies like Subversion or Git is great, while knowledge of version
control is also an advantage.
7. Knowledge about basics of configuration management tools like Puppet and Chef.
By
Mayank Namdev
Asst Prof.
Department of Computer Science and Engineering
SAGAR INSTITUTE OF RESEARCH AND TECHNOLOGY BHOPAL
SAGAR INSTITUTE OF RESEARCH AND TECHNOLOGY BHOPAL
[www.sirtbhopal.ac.in]
8. Skills with system and application monitoring tools like SNMP or Nagios are also important, as they
show your ability as an administrator in a team setting.
9. Knowledge about how to operate virtualized VMWare or Xen Server, Multifunction Server and
Samba
10. An ITIL Foundation certification for Linux system administrator.
SETTING UP A LINUX MULTIFUNCTION SERVER
A Linux machine can be configured as a server either by compiling several well-defined
scripts and off-line downloaded packages or through on-line installation method. Setting up a
multifunction server, the system administrator should have knowledge about a series of shell
commands. A Linux machine can be configured as any of following application servers such as,
• A Web Server (Apache 2.0.x)
• Webalizer for web site statistics Files and directories shared by Linux system, as viewed from a
Windows PC
By
Mayank Namdev
Asst Prof.
Department of Computer Science and Engineering
SAGAR INSTITUTE OF RESEARCH AND TECHNOLOGY BHOPAL
SAGAR INSTITUTE OF RESEARCH AND TECHNOLOGY BHOPAL
[www.sirtbhopal.ac.in]
Server Requirements
To set up a Linux Internet server, we will need a connection to the Internet and a static IP
address. The system can also be setup with the address leased by ISP and configure it statically.
Computer with at least a Pentium III CPU, a minimum of 256 MB of RAM, and a 10 GB
hard drive is preferred. Obviously, a newer CPU and additional memory will provide better
performance. This chapter is based on Debian’s stable version. We strongly suggest using a CD with
the Netinstall kernel. The Debian web site provides downloadable CD images.
Installing & Configuring Network Services
Administrator should log into the server from a remote console on desktop. It is recommended to do
further administration from another system (even a laptop), because a secure server normally runs in
what is called headless mode—that is, it has no monitor or keyboard.
Get used to administering the server like this. A SSH client on the remote machine is needed
which virtually all Linux distributions have and which can be downloaded for other operating
systems as well.
Configuring the Network
If DHCP is used during the Debian installation, Server with a static IP address should
be configured as follows,
1. To change the settings to use a static IP address, you’ll need to become root and edit the
file /etc/network/interfaces to suit your needs. As an example, we’ll use the IP address
70.153.258.42.
2. To add the IP address 70.153.258.42 to the interface eth0, we must change the
file to look like this (you’ll have to obtain some of the information from your ISP):
Auto eth0
Iface eth0 inet static
address 70.153.258.42
netmask 255.255.255.248
network 70.153.258.0
broadcast 70.153.258.47
gateway 70.153.258.46
3. After editing the /etc/network/interfaces file, restart the network by entering:
# /etc/init.d/networking restart
4. To edit /etc/resolv.conf and add nameservers to resolve Internet hostnames to their
corresponding IP addresses. At this point, we will simply set up a minimal DNS server.
Our resolv.conf looks as follows:
search Server
nameserver 70.153.258.42
nameserver 70.253.158.45
nameserver 151.164.1.8
5. Now edit /etc/hosts and add your IP addresses:
127.0.0.1 localhost.localdomain localhost server1 70.153.258.42
server1.centralsoft.org server1
6. Now, to set the hostname, enter these commands:
# echo server1.centralsoft.org > /etc/hostname # /bin/hostname -F
/etc/hostname
7. verify that you configured your hostname correctly by running the hostname
command:
By
Mayank Namdev
Asst Prof.
Department of Computer Science and Engineering
SAGAR INSTITUTE OF RESEARCH AND TECHNOLOGY BHOPAL
SAGAR INSTITUTE OF RESEARCH AND TECHNOLOGY BHOPAL
[www.sirtbhopal.ac.in]
~$ hostname -f
server1.centralsoft.org
Providing Domain Name Services (BIND - the ubiquitous DNS server)
Debian provides a stable version of BIND in its repositories. BIND can be installed, setup and
secure it in a chroot environment, meaning it won’t be able to see or access files outside its own
directory tree. This is an important security technique.
The term chroot refers to the trick of changing the root filesystem (the /directory) that a
process sees, so that most of the system is effectively inaccessible to it.
The BIND server also can be configured to run as a non-root user. That way, if someone
gains access to BIND, he/she won’t gain root privileges or be able to control other processes.
To install BIND on your Debian server, run this command:
# apt-get install bind9
Debian downloads and configures the file as an Internet service and the status can be seen
on the console:
Setting up bind9 (9.2.4-1)
Adding group `bind' (104) - Done. Adding system
user `bind'
Adding new user `bind' (104) with group `bind'. Not creating home
directory.
Starting domain name service: named.
5. To put BIND in a secured environment, create a directory where the service can run
unexposed to other processes. First stop the service by running the following command:
# /etc/init.d/bind9 stop
6. Edit the file /etc/default/bind9 so that the daemon will run as the unprivileged user bind,
chrooted to /var/lib/named. Change the line:
OPTS="-u bind"
So that it reads:
OPTIONS="-u bind -t /var/lib/named"
7. To provide a complete environment for running BIND, create the necessary directories
under /var/lib:
# mkdir -p /var/lib/named/etc # mkdir
/var/lib/named/dev
# mkdir -p /var/lib/named/var/cache/bind # mkdir -p
/var/lib/named/var/run/bind/run
Then move the config directory from /etc to /var/lib/named/etc:
# mv /etc/bind /var/lib/named/etc
Next, create a symbolic link to the new config directory from the old location, to avoid
problems when BIND is upgraded in the future:
# ln -s /var/lib/named/etc/bind /etc/bind
Make null and random devices for use by BIND, and fix the permissions of the directories:
# mknod /var/lib/named/dev/null c 1 3
# mknod /var/lib/named/dev/random c 1 8
Then change permissions and ownership on the files:
# chmod 666 /var/lib/named/dev/null
/var/lib/named/dev/random
# chown -R bind:bind /var/lib/named/var/*
# chown -R bind:bind /var/lib/named/etc/bind
8. Finally, start BIND:
# /etc/init.d/bind9 start
9. To check whether named is functioning without any trouble. Execute this command:
By
Mayank Namdev
Asst Prof.
Department of Computer Science and Engineering
SAGAR INSTITUTE OF RESEARCH AND TECHNOLOGY BHOPAL
SAGAR INSTITUTE OF RESEARCH AND TECHNOLOGY BHOPAL
[www.sirtbhopal.ac.in]
By
Mayank Namdev
Asst Prof.
Department of Computer Science and Engineering
SAGAR INSTITUTE OF RESEARCH AND TECHNOLOGY BHOPAL
SAGAR INSTITUTE OF RESEARCH AND TECHNOLOGY BHOPAL
[www.sirtbhopal.ac.in]
Virtualization
Virtualization refers to the act of creating a virtual (rather than actual) version of something,
including a virtual computer hardware platform, operating system (OS), storage device, or
computer network resources.
By
Mayank Namdev
Asst Prof.
Department of Computer Science and Engineering
SAGAR INSTITUTE OF RESEARCH AND TECHNOLOGY BHOPAL
SAGAR INSTITUTE OF RESEARCH AND TECHNOLOGY BHOPAL
[www.sirtbhopal.ac.in]
For example, a computer that is running Microsoft Windows may host a virtual machine
that looks like a computer with the Ubuntu Linux operating system; Ubuntu-based
software can be run on the virtual machine.
Hardware Virtualization
Benefits of Virtualization
1. Instead of deploying several physical servers for each service, only one server
can be used. Virtualization let multiple OSs and applications to run on a server at
a time. Consolidate hardware to get vastly higher productivity from fewer
servers.
2. If the preferred operating system is deployed as an image, so we needed to go
through the installation process only once for the entire infrastructure.
3. Improve business continuity: Virtual operating system images allow us for
instant recovery in case of a system failure. The crashed system can be restored
back by coping the virtual image.
4. Increased uptime: Most server virtualization platforms offer a number of
advanced features that just aren't found on physical servers which increases
servers’ uptime. Some of features are live migration, storage migration, fault
tolerance, high availability, and distributed resource scheduling.
5. Reduce capital and operating costs: Server consolidation can be done by
running multiple virtual machines (VM) on a single physical server. Fewer
servers means lower capital and operating costs.
By
Mayank Namdev
Asst Prof.
Department of Computer Science and Engineering
SAGAR INSTITUTE OF RESEARCH AND TECHNOLOGY BHOPAL
SAGAR INSTITUTE OF RESEARCH AND TECHNOLOGY BHOPAL
[www.sirtbhopal.ac.in]
Architecture - Virtualization
The heart of virtualization is the “virtual machine” (VM), a tightly isolated software
container with an operating system and application inside. Because each virtual machine is
completely separate and independent, many of them can run simultaneously on a single
computer. A thin layer of software called a hypervisor decouples the virtual machines from
the host and dynamically allocates computing resources to each virtual machine as needed.
This architecture redefines your computing equation and delivers:
Many applications on each server: As each virtual machine encapsulates an entire
machine, many applications and operating systems can run on a single host at the same
time.
Maximum server utilization, minimum server count: Every physical machine is
used to its full capacity, allowing you to significantly reduce costs by deploying fewer
servers overall.
Faster, easier application and resource provisioning: As self-contained software
files, virtual machines can be manipulated with copy-and-paste ease. Virtual machines
can even be transferred from one physical server to another while running, via a
process known as live migration.
By
Mayank Namdev
Asst Prof.
Department of Computer Science and Engineering
SAGAR INSTITUTE OF RESEARCH AND TECHNOLOGY BHOPAL