Senior Software Engineering Student Robertas Sys

Slides:



Advertisements
Similar presentations
Java Card Technology Ch07: Applet Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Computer Science & Engineering.
Advertisements

Week 6: Chapter 6 Agenda Automation of SQL Server tasks using: SQL Server Agent Scheduling Scripting Technologies.
Lesson 17: Configuring Security Policies
15.1 © 2004 Pearson Education, Inc. Exam Managing and Maintaining a Microsoft® Windows® Server 2003 Environment Lesson 15: Configuring a Windows.
Computer Monitoring System for EE Faculty By Yaroslav Ross And Denis Zakrevsky Supervisor: Viktor Kulikov.
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment, Enhanced Chapter 9: Implementing and Using Group Policy.
RPC Project Using either sockets or TLI, implement Remote Procedure Calls between two distinct machines that are communicating over an Ethernet network.
11 ADMINISTERING MICROSOFT WINDOWS SERVER 2003 Chapter 2.
WNT Client/Server SDK Tony Vaccaro CS699 Project Presentation.
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment Chapter 8: Implementing and Managing Printers.
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment, Enhanced Chapter 10: Server Administration.
Check Disk. Disk Defragmenter Using Disk Defragmenter Effectively Run Disk Defragmenter when the computer will receive the least usage. Educate users.
11 SYSTEMS ADMINISTRATION AND TERMINAL SERVICES Chapter 12.
Event Viewer Was of getting to event viewer Go to –Start –Control Panel, –Administrative Tools –Event Viewer Go to –Start.
1 Chapter Overview Monitoring Server Performance Monitoring Shared Resources Microsoft Windows 2000 Auditing.
®® Microsoft Windows 7 for Power Users Tutorial 8 Troubleshooting Windows 7.
WINDOWS SERVICES. Introduction You often need programs that run continuously in the background Examples: – servers –Print spooler You often need.
Understanding the CORBA Model. What is CORBA?  The Common Object Request Broker Architecture (CORBA) allows distributed applications to interoperate.
Chapter Fourteen Windows XP Professional Fault Tolerance.
Microsoft ® Official Course Module XA Using Windows PowerShell ®
Copyright © 2007, Oracle. All rights reserved. Managing Concurrent Requests.
By Lecturer / Aisha Dawood 1.  You can control the number of dispatcher processes in the instance. Unlike the number of shared servers, the number of.
Appendix A Starting Out with Windows PowerShell™ 2.0.
Module 7: Fundamentals of Administering Windows Server 2008.
Windows Vista Inside Out Chapter 22 - Monitoring System Activities with Event Viewer Last modified am.
ITN Wake Tech1 ITN270 Advanced Internet Databases Lecture 15. General MySQL Administration Topics: –Securing a New MySQL Installation –MySQL Server.
Remote Procedure Calls Adam Smith, Rodrigo Groppa, and Peter Tonner.
Module 9: Preparing to Administer a Server. Overview Introduction to Administering a Server Configuring Remote Desktop to Administer a Server Managing.
Implementing Remote Procedure Calls Authored by Andrew D. Birrell and Bruce Jay Nelson Xerox Palo Alto Research Center Presented by Lars Larsson.
Learningcomputer.com SQL Server 2008 – Administration, Maintenance and Job Automation.
Oracle 10g Database Administrator: Implementation and Administration Chapter 2 Tools and Architecture.
1 Chapter Overview Preparing to Upgrade Performing a Version Upgrade from Microsoft SQL Server 7.0 Performing an Online Database Upgrade from SQL Server.
1 Chapter Overview Performing Configuration Tasks Setting Up Additional Features Performing Maintenance Tasks.
Module 6: Managing and Monitoring Domain Name System (DNS)
1 Chapter Overview Managing Object and Container Permissions Locating and Moving Active Directory Objects Delegating Control Troubleshooting Active Directory.
Configuring and Troubleshooting Identity and Access Solutions with Windows Server® 2008 Active Directory®
Administering Groups Chapter Eight. Exam Objectives In this Chapter:  Plan a security group hierarchy based upon delegation requirements  Plan a security.
ERICSON BRANDON M. BASCUG Alternate - REGIONAL NETWORK ADMINISTRATOR HOW TO TROUBLESHOOT TCP/IP CONNECTIVITY.
Linux Operations and Administration
Understand Windows Services Software Development Fundamentals LESSON 5.3.
Troubleshooting Windows Vista Lesson 11. Skills Matrix Technology SkillObjective DomainObjective # Troubleshooting Installation and Startup Issues Troubleshoot.
Administering Windows Server 2012 Question Answer.
SQL Database Management
VMware ESX and ESXi Module 3.
Module 9: Preparing to Administer a Server
Running a Forms Developer Application
Chapter Objectives In this chapter, you will learn:
Module Overview Installing and Configuring a Network Policy Server
Section 13 - Integrating with Third Party Tools
Crash Dump Analysis - Santosh Kumar Singh.
Router Startup and Setup
CHAPTER 14 - DEBUGGING WINDOWS SERVICES
Module 4 Remote Login.
Network Load Balancing
LCGAA nightlies infrastructure
Out-of-Process Components
Ch > 28.4.
Programming Models for Distributed Application
TRIP WIRE INTRUSION DETECTION SYSYTEM Presented by.
Windows Processes and Services
Router Startup and Setup
Windows Server Administration Fundamentals
Windows API: Network Policy Server Extensions
Out-of-Process Components
Channel Access Concepts
Overview Multimedia: The Role of WINS in the Network Infrastructure
Module 9: Preparing to Administer a Server
Creating and Managing Folders
Exceptions and networking
Infokall Enterprise Solutions
Presentation transcript:

Senior Software Engineering Student Robertas Sys services Senior Software Engineering Student Robertas Sys

Service Computer program which is running in the background Works without user intervention Implements SCM (Service Control Manager) interface Can perform various tasks Windows service is a service application conforms to the interface rules of the Service Control Manager (SCM). It can be started automatically at system boot, by a user through the Services control panel applet, or by an application that uses the service functions. Services can execute even when no user is logged on to the system. Computer program which is running in the background Works without user intervention Can perform various tasks from resource monitoring and management to very custom needs Provides access to operating system resources Doesn’t stop running in user idle or lock mode Formally called NT services (new technology services) Can be started automatically, manually, on system boot etc. Implements SMC (Service Control manager) interface

Have you seen one of these? Everybody had hit that point where you have been forced to check out your windows services to diagnose, troubleshoot and resolve computer problems.

Service Control Manager (SCM) Maintaining the database of installed services Starting services and driver services either upon system startup or upon demand Enumerating installed services and driver services Maintaining status information for running services and driver services Transmitting control requests to running services Locking and unlocking the service database The service control manager (SCM) maintains a database of installed services and driver services, and provides a unified and secure means of controlling them. The database includes information on how each service or driver service should be started. It also enables system administrators to customize security requirements for each service and thereby control access to the service. The service control manager (SCM) is started at system boot. It is a remote procedure call (RPC) server, so that service configuration and service control programs can manipulate services on remote machines.

Types of programs using SCM functions Service program Service configuration program Service control program The following types of programs use the functions provided by the SCM: Service program - A program that provides executable code for one or more services. Service programs use functions that connect to the SCM and send status information to it. Service configuration program - A program that queries or modifies the services database. Service configuration programs use functions that open the database, install or delete services in the database, and query or modify the configuration and security parameters for installed services. Service control program - A program that starts and controls services and driver services. Service control programs use functions that send requests to the SCM, which carries out the request.

Service programs SERVICE_WIN32_OWN_PROCESS SERVICE_WIN32_SHARE_PROCESS A service program contains executable code for one or more services. A service program created with the type SERVICE_WIN32_OWN_PROCESS contains the code for only one service. A service program created with the type SERVICE_WIN32_SHARE_PROCESS contains code for more than one service, enabling them to share code. An example of a service program that does this is the generic service host process, Svchost.exe, which hosts internal Windows services. Note that Svchost.exe is reserved for use by the operating system and should not be used by non-Windows services. Instead, developers should implement their own service hosting programs. A service program can be configured to execute in the context of a user account from either the built-in (local), primary, or trusted domain. It can also be configured to run in a special service user account. The following slides describe the interface requirements of the service control manager (SCM) that a service program must include:

Service Entry Point Purpose: Entry point for the process Services are generally written as console applications. The entry point of a console application is its main function. The main function receives arguments from the ImagePath value from the registry key for the service. When the SCM starts a service program, it waits for it to call the StartServiceCtrlDispatcher function. Use the following guidelines. A service of type SERVICE_WIN32_OWN_PROCESS should call StartServiceCtrlDispatcher immediately, from its main thread. You can perform any initialization after the service starts, as described in Service ServiceMain Function. If the service type is SERVICE_WIN32_SHARE_PROCESS and there is common initialization for all services in the program, you can perform the initialization in the main thread before calling StartServiceCtrlDispatcher, as long as it takes less than 30 seconds. Otherwise, you must create another thread to do the common initialization, while the main thread calls StartServiceCtrlDispatcher. You should still perform any service-specific initialization after the service starts. The StartServiceCtrlDispatcher function takes a SERVICE_TABLE_ENTRY structure for each service contained in the process. Each structure specifies the service name and the entry point for the service.

Service ServiceMain function Purpose: Entry point for the service Parameters: dwArgc - Number of arguments in the lpszArgv array lpszArgv - Array of strings. The first string is the name of the service and subsequent strings are passed by the process that called the StartService function to start the service. When a service control program requests that a new service run, the Service Control Manager (SCM) starts the service and sends a start request to the control dispatcher. The control dispatcher creates a new thread to execute the ServiceMain function for the service. 1. Initialize all global variables. 2. Call the RegisterServiceCtrlHandler function immediately to register a Handler function to handle control requests for the service. The return value of RegisterServiceCtrlHandler is a service status handle that will be used in calls to notify the SCM of the service status. 3. Perform initialization. If the execution time of the initialization code is expected to be very short (less than one second), initialization can be performed directly in ServiceMain. 4. When initialization is complete, call SetServiceStatus to set the service state to SERVICE_RUNNING and specify the controls that the service is prepared to accept. 5. Perform the service tasks, or, if there are no pending tasks, return control to the caller. Any change in the service state warrants a call to SetServiceStatus to report new status information. 6. If an error occurs while the service is initializing or running, the service should call SetServiceStatus to set the service state to SERVICE_STOP_PENDING if cleanup will be lengthy. After cleanup is complete, call SetServiceStatus to set the service state to SERVICE_STOPPED from the last thread to terminate. Be sure to set the dwServiceSpecificExitCode and dwWin32ExitCode members of the SERVICE_STATUS structure to identify the error.

Service Control Handler function Purpose: Called by SCM whenever a control code is sent to the service using the ControlService function. Parameters: dwCtrl - control code Each service has a control handler, the Handler function, that is invoked by the control dispatcher when the service process receives a control request from a service control program. When a Handler function is called by the dispatcher thread, it handles the control code passed in the Opcode parameter and then calls the ReportSvcStatus function to update the service status. When a Handler function receives a control code, it should report the service status only if handling the control code causes the service status to change. If the service does not act on the control, it should not report status to the service control manager.

Service Installation / Removal Installation (command line) sc create “name of the service” binPath=“Path to service program” Removal (command line) sc delete “name of the service”

Applying services in real life https://www.cathrinewilhelmsen.net/2015/05/12/custom-real-time-monitoring- solution/

Questions?