1. Depending on how the system starts, the Linux system service (daemon, daemon, from the meaning definition of the program, a service needs a daemon) is divided into self-initiated service and the service by Super Daemon (early inetd, now XINETD) unified management of the two major categories.
2. Independent Start-up service: This kind of service is resident memory, once started, there will always be in-memory continuous service, eg:www,ftp.
3. Services managed by daemon: This service is responsive, that is, when there is no client request, the services are not started, wait until there is a client request, Super Daemon wake the corresponding service, when the client's request is over, the service will be woken up and released resources. Advantages: Security, can be set up security control mechanism, that is, firewall; disadvantage: slow. Category: Single thread, multi-threaded.
4. Service according to the work status can be divided into: signal control (Single-control), that is, as long as any client needs come in, will start to deal with, eg: printer services; interval control (interval), that is, every once in a while.
The name of the 5.linux service will be appended with a d.
6./etc/services: Specifies the port number of each service.
7. After the service is started, its PID will be recorded in the/var/run/directory.
8.linux system service startup script and configuration file directory:
1)/etc/init.d/: Startup Script Repository
2)/etc/sysconfig/: Initialize the environment configuration file for each service
3)/etc/xinetd.conf,etc/xinetd.d/:super daemon configuration file. /etc/xinetd.conf,super Daemon's main configuration file, and other daemon it manages are written under/etc/xinetd.d/
4)/etc/: The various configurations of each service.
5)/var/lib/: The database generated by each service, Eg:mysql writes temporary files to/var/lib/mysql/.
6)/var/run/: PID of the procedure of each service.
9.service [Service name] (start|stop|restart| ...): Start a standalone startup service--status-all: Displays the running status of all services on the current system.
10.xinetd.conf:super Daemon Important configuration interpretation,
1) Log_type=sys Daemon Info: Logging Service type of login file
2) Log_on_falure=host: The information that needs to be logged when an error occurs is the host
3) log_on_success:pid HOST DURATION EXIT: Record information when logging on successfully
4) cps= 50 10: The maximum number of connections in the same second is 50, if more than 10 seconds (time period)
One) Instance=50: The maximum number of simultaneous connections for the same service. (Point in time)
PER_SOURCE=10: Maximum number of online clients from the same source
V6only=no: Whether to allow IPv6.
The configuration file under 11./etc/xinetd.d/reads:
1) Disable=[yes|no]: Set whether the service will start
2) id= server name
3) Full path to the server= program
4) server_args= program-related parameters, that is, through the server instructions need to pass in parameters
5) user= user account: Set the identity to start the service program
6) group= Group name
7) Socket_type=[stream|dgram|raw]:stream for online more reliable TCP packet, Dgram is UDP packet, Raw is said to need yo directly in the IP talk.
8) PROTOCOL=[TCP|UDP]: Packet type. Because it is duplicated with socket_type, it can be unspecified.
9) Wait=[yes (single) |no (multi)]: preset wait=no. Yes single thread, no multithreading.
) instance=[Numbers | UNLIMITED]: Set maximum number of online
One) per_source=[number | UNLIMITED]: Sets the maximum number of connections for an IP.
cps= Two digits: Sets the maximum number of connections in the same second, if more than the paused seconds
log_type=[Login Project level]: Set login entries and levels
) Log_on_success=[pid,host,userid,exit,duration],log_on_falure==[pid,host,userid,exit,duration]: Login success or failure needs to record the project, host is the remote host's Ipuserid is the login account, exit for the time of the leave to record the project duration for the user to use this service for how long.
env=[variable name = variable content]: Set environment variables
port=[less than 65534]: set port, need to be consistent with/etc/services
Redirect=[ip Port]: Setting up service redirection
includedir=[Directory name]: All files in the specified directory are introduced.
BIND=[IP]: Sets the IP value for this service. Once set, the service can only be accepted through that IP.
) Interface=[ip]: with BIND
only_from=[0.0.0.0, 192.168.1.0/24, hostname, DomainName]: Restricts access to the service except to set IP IP.
ACCESS_TIME=[00:00-12:00,HH:MM-HH:MM]: Sets the time for the service to run.
Umask: Set Umask.
It is also important to note three operators, =: setpoint, + =: Append value,-=: Remove value.
12. Services managed by xinted can be/etc/hosts.allow,/etc/hosts.deny to set up firewalls. These two files provide a unified portal for XINETD Management services. These two files are also/USR/BIN/TCPD's configuration files. This instruction is used to analyze a software that enters the TCP network packet of the system. As long as the software that supports the TCP wrappers function can be configured with both software to restrict access. Configuration format: "Service name: IP or domain name: action", eg:rsync:rsync:127.0.0.100 127.0.0.200:deny, you can set multiple lines, where *.allow,action default is allow can not write, *.deny the same. Some special meanings of fields:
All: Available in program name or IP, Eg,all:all:deny
Local: This machine, used in IP, Eg,all:local:allow
UNKNOWN: Represents an IP or domain name or service that you do not know
Known: Represents the resolvable IP, domain name and other information.
13.LDD $ (which sshd httpd): View httpd Whether this service supports TCP Wrappers,lld (library dependency discovery).
This article is from "Tiger Brother's Blog" blog, please be sure to keep this source http://7613577.blog.51cto.com/7603577/1600469
Linux System Services