Daemon category:
Based on the startup and management methods, it can be divided into standalone stand alone, and services managed in a unified manner through a super daemon.
Stand alone: it is started independently and has been in memory since it was started. It requires fast response to the client.
Super daemon: A special daemon for unified management. The service is not started when the client has no requirements.
Super daemon wakes up the service. After the request is completed, the service is disabled.
Set/etc/services on the system to correspond the service to the port
[Root @ lyy ~] # Cat/etc/services | grep telnet
Telnet 23/tcp
Telnet 23/udp
Rtelnet 107/tcp # Remote Telnet
Rtelnet 107/udp
Telnetts 992/tcp
Telnetts 992/udp
/Etc/hosts. allow,/etc/hosts. deny Management
Only for program management using TCP, the two files are judged to be/etc/hosts. allow first
1. Write in/etc/hosts. allow.
2. If the access is not allowed, write it in/etc/hosts. deny.
Configuration File Syntax:
Service: ip, domain, hostname: action
Service name ip domain name, host name action
For example, access to the host through rsync is denied for 127.0.0.100 and 127.0.0.200.
[Root @ lyy ~] # Vi/etc/hosts. deny
Rsync: 127.0.0.100 127.0.0.200: deny # deny can be omitted
Observe all service statuses
[Root @ lyy ~] # Service -- status-all
Acpid (pid 3304) is running...
Anacron (pid 3603) is running...
Atd (pid 3616) is running...
Auditd (pid 2577) is running...
Automount (pid 3406) is running...
Running Avahi daemon
Avahi DNS daemon is not running
Hcid (pid 3218) is running...
Sdpd (pid 3231) is running...
Capi not installed-No such file or directory (2)
Conmand stopped
Cpuspeed stopped
Crond (pid 3545) is running...
-------------- Slightly ---------------------------
View the independent execution status of a process using service named status
Run chkconfig -- list | grep sunflower to summon sand e
Manage whether or not the system service is started by default. chkconfig
Using chkconfig does not cause the service to be started immediately or immediately shut down. Instead
It is loaded or canceled only when it is started.
Parameters:
-- List to list the current services
-- Level: Enables or disables a service at this level.
[Root @ lyy init. d] # chkconfig -- list
NetworkManager 0: Close 1: Close 2: Close 3: Close 4: Close 5: Close 6: Close
Acpid 0: off 1: off 2: Enable 3: Enable 4: Enable 5: Enable 6: Disable
Anacron 0: off 1: off 2: Enable 3: Enable 4: Enable 5: Enable 6: Disable
Apmd 0: Disable 1: Disable 2: Enable 3: Enable 4: Enable 5: Enable 6: Disable
Atd 0: Disable 1: Disable 2: Enable 3: Enable 4: Enable 5: Enable 6: Disable
Auditd 0: off 1: off 2: Enable 3: Enable 4: Enable 5: Enable 6: Disable
Autofs 0: Disable 1: Disable 2: Disable 3: Enable 4: Enable 5: Enable 6: Disable
Avahi-daemon 0: Disable 1: Disable 2: Disable 3: Enable 4: Enable 5: Enable 6: Disable
Avahi-dnsconfd 0: Close 1: Close 2: Close 3: Close 4: Close 5: Close 6: Close
Bluetooth 0: Disable 1: Disable 2: Enable 3: Enable 4: Enable 5: Disable 6: Disable
Capi 0: Close 1: Close 2: Close 3: Close 4: Close 5: Close 6: Close
Conman 0: Close 1: Close 2: Close 3: Close 4: Close 5: Close 6: Close
Cpuspeed 0: off 1: Enable 2: Enable 3: Enable 4: Enable 5: Enable 6: Disable
Crond 0: off 1: off 2: Enable 3: Enable 4: Enable 5: Enable 6: Disable
Cups 0: off 1: off 2: Enable 3: Enable 4: Enable 5: Disable 6: Disable
Dnsmasq 0: Close 1: Close 2: Close 3: Close 4: Close 5: Close 6: Close
Dund 0: Close 1: Close 2: Close 3: Close 4: Close 5: Close 6: Close
Firstboot 0: Disable 1: Disable 2: Disable 3: Enable 4: Disable 5: Enable 6: Disable
Gpm 0: Disable 1: Disable 2: Enable 3: Enable 4: Enable 5: Enable 6: Disable
----------------------------------
Chkconfig: set your own system service
Parameters:
-- Add a service name to chkconfig for management. The service name is in/etc/init. d.
-- Del: delete a service managed by chkconfig.
For example, create a simple script under/etc/init. d and start the script by starting the service.
Steps:
Create test. sh to start at run level 3
Test. sh starts 80 in/etc/rc. d/rc35.d, and ends with 70 in turn.
1. Create the test. sh Program
[Root @ lyy init. d] # touch test. sh
[Root @ lyy init. d] # vi test. sh
#! /Bin/bash
# Chkconfig: 35 80 70
# Description: test example
Echo "NOthing"
Note: chkconfig: [runlevels] Enable and stop a proper position
2. Add a startup Item
[Root @ lyy init. d] # chkconfig -- add test. sh
[Root @ lyy init. d] # chkconfig -- list test. sh
Test. sh 0: Disable 1: Disable 2: Disable 3: Enable 4: Disable 5: Enable 6: Disable
You can use chkconfig -- del to delete a startup Item.
[Root @ lyy init. d] # chkconfig -- del test. sh
[Root @ lyy init. d] # rm/etc/init. d/test. sh
Author "Liyy Study Notes"