Linux daemon introduction and instance details (1)

Source: Internet
Author: User
Tags network function

In Linux, there are many daemon processes, and most servers use daemon. At the same time, the daemon completes many system tasks, such as job planning process crond and printing process lqd.

A Brief Introduction to common daemon processes:

  • Kudzu (hardware detection)
  • Sshd (remote connection)
  • Inetd (network connection)
  • Ldap (Directory Access Protocol)

Linux running level:

The most common ones are 3 and 5.

  • Run level 0: it is used for shutdown. When it is started, it will be used for shutdown.
  • Run level 1: In Single user mode, only the root account is allowed to log on, mainly for system maintenance.
  • Run level 2: enables all users to log on, but does not enable NFS working, that is, there is no network function
  • Run level 3: enables all users to log on and have complete functions. It contains functions not available in run level 2, but is in text mode after startup.
  • Run level 4: defined by the user, but it is identical to run level 3 by default,
  • Run level 5: similar to run level 3, the only difference is that the graphic interface is used after the startup,
  • Run level 6: restart. Restart immediately after startup

Chkconfig changes the running level of the daemon:

You can use the MAN Chkconfig command to view help information.

Common port knowledge

  • Use the Netstat command
  • Netstat-tn view current open port
  • Netstat-tnl: port used to view the listener status
  • Use Lsof with netstat to check which program is started on the corresponding port:
  • Lsof-I: 111 view the PID value and COMMAND of the program port 111
  • Kill 9441 close the port with PID 9441

Ntsysv graphical tool to disable unwanted services

Daemon) is a special process running in the background. It is independent of the control terminal and periodically executes a task or waits to process some events. Daemon is a very useful process. Most Linux servers are implemented using daemon. For example, the Internet server inetd and the Web Server httpd. At the same time, the daemon completes many system tasks. For example, job planning process crond and printing process lpd.

The programming of daemon is not complex. The complicated problem is that different versions of Unix have different implementation mechanisms, resulting in inconsistent programming rules of daemon in different Unix environments. This requires you to note that copying the rules in some books, especially BSD4.3 and earlier versions of System V, will cause errors to Linux. The following describes the programming points of the daemon in Linux and provides detailed examples.


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.