Program Management and SELinux

Source: Internet
Author: User

First, the procedure:

1. In Linux, triggering any event is that the system will define him as a program, and give the program a PID, and according to inspire the user and related attributes of the program, give the PID a set of effective permission settings, from then on, the PID on the system of the action, is related to the permissions of this PID.

2. The system only knows the binary file, let the system work, also need to start a binary file, this binary file is the program.

3. Procedures and processes

    • Programs: Usually binary program, placed in the storage media (hard disk, floppy disk, CD, etc.), in the form of physical files exist.
    • Process: After the program is triggered, the performer's permissions and properties, program code and the required data will be loaded into memory, the operating system gives this memory part of the content of an identifier PID, the process can be said to be a running program.

Second, the sub-parent program and multi-person landing

1.linux Multi-tasking environment

    • Multiple people log into the system and get their own shell, and when it's all bash, everyone executes/bin/bash, but everyone has different permissions. When we log into the system and execute bash, the system has already given us a PID, which is based on the logged-in Uid/gid. (There are 6 command-line windows in Linux, as well as a graphics window.) )
    • Multitasking: Linux allows the CPU to switch between jobs, each of which takes up only a few instructions from the CPU, and currently has a CPU speed of up to several GHz, representing the CPU's ability to operate 10 of the 9-time instructions per second.

2. Subroutines and Parent programs:

    • Use the "ps-l" command to view the PID and Ppid, where Ppid is the PID of the parent process
    • The complex point of the parent and child processes is the call between the program and the other. In Linux is often called the fork-and-exec process, the program through the parent program to copy (fork) to produce an identical subroutine, and then copied out of the subroutine in an exec way to perform the actual program, eventually become a subroutine exists.

Third, work management

1. Common commands

    • & Symbol, after a command is finished, adding it at the end represents the command running in the background. Bash then gives the command a job number . (When the command executes, it will automatically jump out of the alert.) [Job number]+]
    • View working status in the background: Jobs command
      • -L: The colleague lists the PID numbers in addition to the job number and instructions.
      • -R: Lists only the work being run in the background
      • -S: Lists only the work that is paused in the background.
    • FG%num throws a task in the background with NUM to run in the foreground
    • BG%num changes the paused command in the background to continue running in the background
    • Kill
      • -1: Retrieve the configuration file of the parameter again (similar to reload)
      • -9: Immediately forcibly delete a job.
      • -15: Terminate a job in a normal program manner.
      • -L (can also be lowercase) prints out what numbers the kill can use

Iv. Management of Procedures

Query the system on the running program, you can use static PS, dynamic top, but also can be pstree to query the relationship between the program book

1. Common commands

    • PS command
      • -A: All process is displayed, not-e has the same effect
      • -A: All process unrelated to terminal (terminal);
      • -U: There are material pasted into users (effective user) related process;
      • X: This parameter is usually not used together to list more complete information.
        Output format planning:
        L: The information of the PID is listed by a longer and more detailed gentleman;
        J: Format of work (jobs format)
        -F: Make a more complete output.

Program Management and SELinux

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.