WINDOWS SERVICES. Introduction You often need programs that run continuously in the background Examples: –Email servers –Print spooler You often need.

Slides:



Advertisements
Similar presentations
This course is designed for system managers/administrators to better understand the SAAZ Desktop and Server Management components Students will learn.
Advertisements

OPERATING SYSTEM An operating system is a group of computer programs that coordinates all the activities among computer hardware devices. It is the first.
Operating-System Structures
Discovering Computers Fundamentals, Third Edition CGS 1000 Introduction to Computers and Technology Fall 2006.
Chapter 10 Chapter 10: Printer Management. Chapter 10 Learning Objectives n Describe the printing process used by Windows NT n Install a local printer.
9.1 © 2004 Pearson Education, Inc. Exam Managing and Maintaining a Microsoft® Windows® Server 2003 Environment Lesson 9: Installing and Configuring.
Figure 1.1 Interaction between applications and the operating system.
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment Chapter 8: Implementing and Managing Printers.
Module 6 Windows 2000 Professional 6.1 Installation 6.2 Administration/User Interface 6.3 User Accounts 6.4 Managing the File System 6.5 Services.
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment, Enhanced Chapter 10: Server Administration.
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment, Enhanced Chapter 8: Implementing and Managing Printers.
1 I/O Management in Representative Operating Systems.
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment Chapter 8: Implementing and Managing Printers.
Chapter 8: Network Operating Systems and Windows Server 2003-Based Networking Network+ Guide to Networks Third Edition.
Linux+ Guide to Linux Certification, Second Edition
Operating Systems.
Check Disk. Disk Defragmenter Using Disk Defragmenter Effectively Run Disk Defragmenter when the computer will receive the least usage. Educate users.
Installing Windows XP Professional Using Attended Installation Slide 1 of 41Session 2 Ver. 1.0 CompTIA A+ Certification: A Comprehensive Approach for all.
1 Network File System. 2 Network Services A Linux system starts some services at boot time and allow other services to be started up when necessary. These.
Printing Terminology. Requirements for Network Printing At least one computer to operate as the print server Sufficient RAM to process documents Sufficient.
Windows Server 2008 Chapter 11 Last Update
Overview SAP Basis Functions. SAP Technical Overview Learning Objectives What the Basis system is How does SAP handle a transaction request Differentiating.
Windows Server 2008 Chapter 6 Last Update
Chapter 13: Sharing Printers on Windows Server 2008 R2 Networks BAI617.
Windows Programming Using C# Windows Services, Serialization, and Isolated Storage.
Installing and Troubleshooting Hardware Device and Drivers Chapter 6 powered by dj.
Operating system Part two Introduction to computer, 2nd semester, 2010/2011 Mr.Nael Aburas Faculty of Information.
Windows Services XML Web Services Certification SIG Tom Perkins.
6/1/2001 Supplementing Aleph Reports Using The Crystal Reports Web Component Server Presented by Bob Gerrity Head.
A+ Guide to Managing and Maintaining Your PC Fifth Edition Chapter 15 Installing and Using Windows XP Professional.
Sharing Resources Lesson 6. Objectives Manage NTFS and share permissions Determine effective permissions Configure Windows printing.
Understanding Computers1 Chapter 5 System Software: Operating Systems and Utilities.
Ch 11. Services A service is a specialized program that performs a function to support other programs Many services operate at a very low level – Interacting.
Chapter 6 Configuring Windows Server 2008 Printing
A+ Guide to Managing and Maintaining Your PC Fifth Edition Chapter 14 Managing and Troubleshooting Windows 2000.
 Wallace B. McClure  Scalable Development, Inc. Scalable Development, Inc. Building systems today that perform tomorrow. Designing & Building Windows.
University of Management & Technology 1 Operating Systems & Utility Programs.
Components of Database Management System
Software Writer:-Rashedul Hasan Editor:- Jasim Uddin.
Chapter 2: Operating-System Structures. 2.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 2: Operating-System Structures Operating.
Guide to Linux Installation and Administration, 2e1 Chapter 2 Planning Your System.
A+ Guide to Managing and Maintaining Your PC Fifth Edition Chapter 13 Understanding and Installing Windows 2000 and Windows NT.
Windows NT Operating System. Windows NT Models Layered Model Client/Server Model Object Model Symmetric Multiprocessing.
CE Operating Systems Lecture 3 Overview of OS functions and structure.
Module 5: Implementing Printing. Overview Introduction to Printing in the Windows Server 2003 Family Installing and Sharing Printers Managing Access to.
11 WORKING WITH PRINTERS Chapter 10. Chapter 10: WORKING WITH PRINTERS2 THE WINDOWS SERVER 2003 PRINTER MODEL  Locally attached printers Printers that.
Page 1 Printing & Terminal Services Lecture 8 Hassan Shuja 11/16/2004.
1 3 Computing System Fundamentals 3.3 Computer Systems.
Understanding Desktop Applications Lesson 5. Objective Domain Matrix Skills/ConceptsMTA Exam Objectives Understanding Windows Forms Applications Understand.
Chapter 3 Operating Systems. © 2005 Pearson Addison-Wesley. All rights reserved 3-2 Chapter 3 Operating Systems 3.1 The Evolution of Operating Systems.
Understand Windows Services Software Development Fundamentals LESSON 5.3.
Hands-On Microsoft Windows Server 2008 Chapter 5 Configuring Windows Server 2008 Printing.
Understanding Desktop Applications Lesson 5. Understanding Windows Forms Applications Windows Forms applications are smart client applications consisting.
Computer Operating Systems And Software applications.
Configuring Print Services Lesson 7. Print Sharing Print device sharing is another one of the most basic applications for which local area networks were.
Operating System (Reference : OS[Silberschatz] + Norton 6e book slides)
 Project Team: Suzana Vaserman David Fleish Moran Zafir Tzvika Stein  Academic adviser: Dr. Mayer Goldberg  Technical adviser: Mr. Guy Wiener.
Hands-On Microsoft Windows Server 2008 Chapter 6 Configuring Windows Server 2008 Printing.
6/19/2016 أساسيات الأتصال و الشبكات Communication & Networks Fundamentals lab 4.
Systems Software / The Operating System CSC October 14, 2010.
1 Major Printer Administration Tasks Managing printers Managing documents Troubleshooting printers Performing tasks requiring the Manage Printers permission.
A+ Guide to Managing and Maintaining Your PC, 7e Chapter 2 Introducing Operating Systems.
2Operating Systems  Program that runs on a computer  Manages hardware resources  Allows for execution of programs  Acts as an intermediary between.
SQL Database Management
Chapter Objectives In this chapter, you will learn:
Chapter 2: System Structures
Introduction to Operating System (OS)
Senior Software Engineering Student Robertas Sys
Oracle Solaris Zones Study Purpose Only
Windows Service Applications
Presentation transcript:

WINDOWS SERVICES

Introduction You often need programs that run continuously in the background Examples: – servers –Print spooler You often need programs that run continuously in the background Examples: – servers –Print spooler

Operating Systems Provisions UNIX: Daemons Windows NT: NT Services Windows 2000, Windows XP, Windows Server 2003: Windows services UNIX: Daemons Windows NT: NT Services Windows 2000, Windows XP, Windows Server 2003: Windows services

Facilities For Integrating Products With Windows OS The Windows operating system provides a set of services that allow device manufacturers and software vendors to integrate their products with the operating system.

Requirements of Windows Services Created as normal executable files Must conform to the interface of the Services Control Manager (SCM), which manages Windows services Must be installed in the Windows services database before use Created as normal executable files Must conform to the interface of the Services Control Manager (SCM), which manages Windows services Must be installed in the Windows services database before use

Skills Needed Create a Windows service that conforms to SCM interface Create an installer class that is capable of installing a Windows service to the Windows service database Create a Windows service that conforms to SCM interface Create an installer class that is capable of installing a Windows service to the Windows service database

Skills Needed (cont’d) Use the Installer tool (installutil.exe) to install and uninstall a Windows service to the Windows service database Connect to a Windows service and issue messages such as start, stop, and continue Query a Windows service to retrieve its status Use the Installer tool (installutil.exe) to install and uninstall a Windows service to the Windows service database Connect to a Windows service and issue messages such as start, stop, and continue Query a Windows service to retrieve its status

Facilities (cont’d) Kernel Services –Core part of operating system responsible for process, thread, and memory management –Enables devices and application to interact with the kernel and use its functionality –Used by systems programmers Kernel Services –Core part of operating system responsible for process, thread, and memory management –Enables devices and application to interact with the kernel and use its functionality –Used by systems programmers

Facilities (cont’d) Device Driver Services –A device driver controls and manages a specific type of hardware device –Device driver services enable applications to work with devices –Used by systems programmers Device Driver Services –A device driver controls and manages a specific type of hardware device –Device driver services enable applications to work with devices –Used by systems programmers

Facilities (cont’d) Windows Services –Enables operating system components and application programs to expose their functionality to other applications –Applications programmers use this service Windows Services –Enables operating system components and application programs to expose their functionality to other applications –Applications programmers use this service

Characteristics of Windows Services Conformance to SCM –Must implement a set of well-known methods, which enable the service to communicate with the SCM –E.g.: Stop, Start, Continue, Pause –Not all Windows services handle all messages Conformance to SCM –Must implement a set of well-known methods, which enable the service to communicate with the SCM –E.g.: Stop, Start, Continue, Pause –Not all Windows services handle all messages

Characteristics of Windows Services (cont’d) Examples: –Event Log and Plug and Play do not accept Pause and Stop messages –Print Spooler accepts Start and Stop, but not Pause Examples: –Event Log and Plug and Play do not accept Pause and Stop messages –Print Spooler accepts Start and Stop, but not Pause

Characteristics of Windows Services (cont’d) Lack of User Interface –Can have user interface, but most do not –They perform system tasks that usually do not require user interface –Example: IIS Launched when OS is booted up Is unseen by user, doesn’t require interface Lack of User Interface –Can have user interface, but most do not –They perform system tasks that usually do not require user interface –Example: IIS Launched when OS is booted up Is unseen by user, doesn’t require interface

Characteristics of Windows Services (cont’d) Long-lived Process –Typically, is started automatically and continues to live –Can execute even when no user is logged on Long-lived Process –Typically, is started automatically and continues to live –Can execute even when no user is logged on

Characteristics of Windows Services (cont’d) Specific User Identity –Most run with System privileges –System is a special account that Windows uses to perform privileged operations –A service can be launched with a specific user identity, which can be used to restrict permissions Specific User Identity –Most run with System privileges –System is a special account that Windows uses to perform privileged operations –A service can be launched with a specific user identity, which can be used to restrict permissions

Characteristics of Windows Services (cont’d) Specific User Identity (cont’d) –System administrator can accomplish this easily: 1. Set up a user account with the permissions that the administrator wants the service to have 2. Configure the Windows service to run with the user identity that was created in Step 1 Specific User Identity (cont’d) –System administrator can accomplish this easily: 1. Set up a user account with the permissions that the administrator wants the service to have 2. Configure the Windows service to run with the user identity that was created in Step 1

Characteristics of Windows Services (cont’d) Separate Windows Process –A Windows service does not run in the process of the program that communicates with it –Runs in its own process –Can also share a process with another Windows service Separate Windows Process –A Windows service does not run in the process of the program that communicates with it –Runs in its own process –Can also share a process with another Windows service

Characteristics of Windows Services (cont’d) Special Installation Procedure –Cannot be started by just executing the *.exe file –Must be registered with the SCM Special Installation Procedure –Cannot be started by just executing the *.exe file –Must be registered with the SCM

Architecture of Windows Services Windows Service Database Service Control Manager Windows Service Installer Windows Services in execution Windows Service Controller Windows Service Database Service Control Manager Windows Service Installer Windows Services in execution Windows Service Controller

Windows Service Database Located in Registry at –HKEY_LOCAL_MACHINE\SYSTEM\ CurrentControlSet\Services Each service contains following info: - Path to the executable file - Security settings - Startup parameters Located in Registry at –HKEY_LOCAL_MACHINE\SYSTEM\ CurrentControlSet\Services Each service contains following info: - Path to the executable file - Security settings - Startup parameters

Windows Service Database (cont’d) Even though you can directly manipulate the Windows service database by modifying the Windows Registry using regedit, it is recommended that you do not To ensure integrity of the Registry, use the interface provided by SCM Even though you can directly manipulate the Windows service database by modifying the Windows Registry using regedit, it is recommended that you do not To ensure integrity of the Registry, use the interface provided by SCM

Service Control Manager (SCM) A Windows component that maintains the Windows service database Provides a unified way to control, configure and access these services A Windows component that maintains the Windows service database Provides a unified way to control, configure and access these services

Service Control Manager (SCM) (cont’d) Tasks performed: –Accepts requests to install and uninstall Windows services from the database –Starts Windows services either on system startup or on demand –Enumerates installed Windows services –Maintains status information for running services –Transmits control messages to running services –Locks and unlocks the Windows service database Tasks performed: –Accepts requests to install and uninstall Windows services from the database –Starts Windows services either on system startup or on demand –Enumerates installed Windows services –Maintains status information for running services –Transmits control messages to running services –Locks and unlocks the Windows service database

Windows Service Installer Uses the SCM to install, uninstall and repair a Windows service These actions create, delete, and update a Windows service record in the database Stores information about how a service will be started Uses the SCM to install, uninstall and repair a Windows service These actions create, delete, and update a Windows service record in the database Stores information about how a service will be started

Windows Service Installer (cont’d) Information that is stored: –Name that uniquely identifies service –Account name and password under whose identity the service runs –Independent or shared process –How service is started Information that is stored: –Name that uniquely identifies service –Account name and password under whose identity the service runs –Independent or shared process –How service is started

Windows Services in Execution SCM creates a process for a service based on information stored in the Windows service database SCM sends a Start message to the service After a Windows service is started, it continues to run until it receives a Pause or Stop message SCM creates a process for a service based on information stored in the Windows service database SCM sends a Start message to the service After a Windows service is started, it continues to run until it receives a Pause or Stop message

Windows Service Controller Program Starts,Stops, and Pauses a Windows service Resumes execution of a paused Windows service Queries the database to retrieve the status for a Windows service Starts,Stops, and Pauses a Windows service Resumes execution of a paused Windows service Queries the database to retrieve the status for a Windows service

Windows Service Controller Program (cont’d) Installs a new Windows service in the database Uninstalls an installed Windows service from the database Modifies the configuration information for a Windows service Installs a new Windows service in the database Uninstalls an installed Windows service from the database Modifies the configuration information for a Windows service

.NET Framework Support for Windows Services System.ServiceProcess namespace –Contains classes that enable ou to implement, install and control Windows services ServiceBase class –Provides the base-level functionality for a Windows services application System.ServiceProcess namespace –Contains classes that enable ou to implement, install and control Windows services ServiceBase class –Provides the base-level functionality for a Windows services application

.NET Framework Support for Windows Services (cont’d) ServiceProcessInstaller and ServiceInstaller classes –Enable you to use an installation utility such as installutil.exe to install a Windows service application ServiceController class –Enables a program to connect to a Windows service and perform various operations, such as Start, Stop and Query ServiceProcessInstaller and ServiceInstaller classes –Enable you to use an installation utility such as installutil.exe to install a Windows service application ServiceController class –Enables a program to connect to a Windows service and perform various operations, such as Start, Stop and Query

ServiceBase Class Provides basic functionality to a Windows service class Provides its derived classes with some well- knows methods and properties. SCM uses these methods and properties to communicate with Windows services Provides basic functionality to a Windows service class Provides its derived classes with some well- knows methods and properties. SCM uses these methods and properties to communicate with Windows services

Important Members of the ServiceBase Class Properties: –AutoLog –CanPauseAndContinue –CanShutDown –CanStop –EventLog –ServiceName Properties: –AutoLog –CanPauseAndContinue –CanShutDown –CanStop –EventLog –ServiceName

Important Members of the ServiceBase Class (cont’d) Methods: –OnContinue() –OnPause() –OnStart() –OnStop() –Run() Methods: –OnContinue() –OnPause() –OnStart() –OnStop() –Run()

Understanding How SCM Interacts With A Windows Service A Windows service contains one or more classes derived from ServiceBase Only one of these classes can have a Main() method Main() passes instances of the service to Run() Run() passes references to Windows service objects to the SCM SCM uses these objects to send messages to the Windows service A Windows service contains one or more classes derived from ServiceBase Only one of these classes can have a Main() method Main() passes instances of the service to Run() Run() passes references to Windows service objects to the SCM SCM uses these objects to send messages to the Windows service

Example: Start Message SCM finds the path of the Windows service executable file from the Windows service database SCM creates a Windows service process by executing Main() in the Windows service executable SCM finds the path of the Windows service executable file from the Windows service database SCM creates a Windows service process by executing Main() in the Windows service executable

Example: Start Message (cont’d) Main() creates one or more instances of the service class and passes their references to the SCM through the static Run() method The handler associated with the start message – OnStart() is executed –May listen to a port for incoming messages, log events to the event log, spool print jobs, etc. Main() creates one or more instances of the service class and passes their references to the SCM through the static Run() method The handler associated with the start message – OnStart() is executed –May listen to a port for incoming messages, log events to the event log, spool print jobs, etc.