Linux Daemons & amp; Service & amp; Process

Source: Internet
Author: User

1. Daemon is classified by Service startup into Stand alone and Super Daemon

1.1 Stand alone:

1.1.1 Service start mode: you can start the Service independently without the management of other mechanisms,

1.1.2 after the service is started and loaded to the memory, the memory and system resources will be occupied,

1.1.3 advantages: fast response speed (continuously providing services within the memory because the memory is occupied)

1.1.4 columns such as httpd, vsftpd,

1.2 Super Daemon: resident memory; control of IP source, time, and connection; trigger Service and direct Client Request to daemon1 ...; Remove Daemon1... And end the connection.

1.2.1 Service start mode: the Super Daemon can start and manage the Service in a unified manner.

1.2.2 inetd was replaced by Xinetd.

1.2.3 mechanism:

1) when there is no Client Request, all services are stopped;

2) When there is a Client Request, Super Daemon will wake up the corresponding Service;

3) when the Client Request ends, the wake-up Service will also be closed and Release System Resource

1.2.4 advantages:

1) Security Control Mechanism: Super Daemon is responsible for awakening various services, similar to the functions of the network firewall;

2) The System Resource will not be used all the time: because after the Client Request is completed, the Service will be closed;

1.2.5 disadvantages:

Response speed is slower than Stand alone: the Service start is awakened by the client's Request, and then triggered by the unified management of Super Daemon and loaded to the Memory takes a little time;

1.2.6 for example, the telnet Service is centrally managed by Super Daemon.

 

 

Run Super daemon

2. Daemon is classified into Single-Control and Multi-Control by work type.

2.1Single-Control:

Process any Client Request immediately

Example: cupsd (printer service)

2.2interval-Control:

Take the initiative to run a job at intervals

What you need to do is: configure the time and work for the service in the configuration file

For example, atd and crond (the configuration file is detected every minute)

 

3. Daemon naming rules: program name (program file name + d)

Ps and top to observe the running Daemon program

 

4. Service & Port: the configuration file is/etc/servcies.

The IP address (layer-3, used as a route) is equivalent to the road name (Network part) + house number (host part) in front of your home)

When routing (Routing) is used in the network, the path name is used instead of the house number.

Port is equivalent to: several floors in your house

The MAC (Media Access Control, Layer 2, through ARP) address is equivalent: the Foundation Number of the building or private house in your house (such as the real estate license or rural land levy have been stated (almost the only and will not change, there is wood ?)

 

V. Daemon startup mode, Shell Script, and configuration file

Generally, Distribution records the PID started by every Daemon -- to the/var/run/directory.

Each Daemon requires configuration files, runtime environments, and runtime files at startup.

Generally, Distribution will give us a simple STARTUP Script Shell Script to start the function:

 

Path of the startup script file:/etc/init. d/The actual file is stored in/etc/rc. d/init. d/, because init. d/The following files are mostly symlinks (symbolic links) files.

Path to the configuration file of the Service initialization environment:/etc/sysconfig/

Path of each Service's configuration file:/etc/# All the configuration files are placed under/etc/

SuperDaemon configuration file:/etc/xinetd. d/and/etc/xinetd. conf

/Etc/xinetd. d/# main configuration file of Super Daemon (also the default configuration file of Super Daemon)

/Etc/xinetd. conf # other Daemon configurations managed by Super Daemon are written in the header here, and should be Super Daemon (just a unified management mechanism) is a big Manager

Databases generated by various services:/var/lib/# some services that generate data will write their data to the/var/lib directory, for example: the Database Management System MySQL database is written to/var/lib/mysql/by default.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.