CN106406963B - Initialization method and device of Linux system - Google Patents

Initialization method and device of Linux system Download PDF

Info

Publication number
CN106406963B
CN106406963B CN201610864312.6A CN201610864312A CN106406963B CN 106406963 B CN106406963 B CN 106406963B CN 201610864312 A CN201610864312 A CN 201610864312A CN 106406963 B CN106406963 B CN 106406963B
Authority
CN
China
Prior art keywords
program
terminal
terminal monitoring
monitoring program
starting
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201610864312.6A
Other languages
Chinese (zh)
Other versions
CN106406963A (en
Inventor
符志清
汤永翔
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou DPTech Technologies Co Ltd
Original Assignee
Hangzhou DPTech Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou DPTech Technologies Co Ltd filed Critical Hangzhou DPTech Technologies Co Ltd
Priority to CN201610864312.6A priority Critical patent/CN106406963B/en
Publication of CN106406963A publication Critical patent/CN106406963A/en
Application granted granted Critical
Publication of CN106406963B publication Critical patent/CN106406963B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • G06F9/4406Loading of operating system

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)
  • Telephonic Communication Services (AREA)

Abstract

The application provides an initialization method and device of a Linux system, which are applied to terminal equipment carrying the Linux system, wherein the method comprises the following steps: when the terminal monitor loses response, the kernel mode program terminates the terminal monitor; when the terminal monitoring program exits, the system automatically runs the respawn program; then, the respawn program judges whether the starting times of the terminal monitoring program in a preset period reach a preset threshold value; if the starting times reach a preset threshold value, starting a login verification program; and if the starting times do not reach the preset threshold value, restarting the terminal monitoring program. By adopting the technical scheme provided by the application, the usability of the equipment can be improved.

Description

Initialization method and device of Linux system
Technical Field
The present application relates to the field of network communication technologies, and in particular, to an initialization method and apparatus for a Linux system.
Background
The Linux-based operating system (Linux-based derivative system) typically starts a terminal listener after system initialization using the inittab file. The terminal monitoring program can provide a command line interface for a user, and the user can input a command provided by the Linux-based operating system in the command line interface, execute some limited functions of the Linux-based operating system, but cannot directly enter a shell mode of a native Linux system, input a command carried by the native Linux system and perform any operation.
However, when the terminal monitor quits operation due to some abnormal reason (for example, the process is crashed due to a fault, or is actively terminated by a system maintenance person, or the process needs to be restarted in order to repair a local fault of the process, etc.), in order to prevent an illegal visitor from directly operating the device without the highest authority after the terminal monitor crashes, the operating system generally automatically switches to the login verification program, and the terminal monitor can be restarted only after the administrator verifies the terminal monitor through the user account and the password.
Disclosure of Invention
In view of this, the present application provides an initialization method and apparatus for a Linux system, which are applied to a terminal device equipped with the Linux system, and are used to improve usability of the device.
Specifically, the method is realized through the following technical scheme:
an initialization method of a Linux system is applied to a terminal device carrying the Linux system, wherein a respaw program in an inittab file of the Linux system is modified into a custom respaw program (hereinafter, referred to as a respaw program), and the initialization method comprises the following steps:
when the terminal monitoring program loses response, the kernel mode program terminates the terminal monitoring program; when the terminal monitoring program exits, the system automatically runs the program specified by the respawn;
the respawn program judges whether the starting times of the terminal monitoring program in a preset period reach a preset threshold value or not;
if the starting times reach a preset threshold value, starting a login verification program; and if the starting times do not reach the preset threshold value, restarting the terminal monitoring program.
An initialization device of a Linux system is applied to a terminal device carrying the Linux system, wherein a respaw program in an inittab file of the Linux system is modified into a custom respaw program (hereinafter, referred to as the respaw program), and the initialization device comprises:
the operation unit is used for stopping the terminal monitoring program by the kernel mode program when the terminal monitoring program loses response; when the terminal monitoring program exits, the system automatically runs the program specified by the respawn;
the judging unit is used for judging whether the starting times of the terminal monitoring program in the preset period reach a preset threshold value by the respawn program;
the execution unit is used for starting a login verification program if the starting times reach a preset threshold value; and if the starting times do not reach the preset threshold value, restarting the terminal monitoring program.
According to the technical scheme provided by the application, when the terminal monitoring program loses correspondence, the kernel mode program terminates the terminal monitoring program; when the terminal monitoring program exits, the system automatically runs the respawn program; then judging whether the starting times of the terminal monitoring program in a preset period reach a preset threshold value by the reapawn program; if the starting times reach a preset threshold value, starting a login verification program; and if the starting times do not reach the preset threshold value, restarting the terminal monitoring program.
On one hand, the automatic restart program respawn of the system is changed into a self-defined program, and the self-defined program can start the terminal monitoring program, so that the program in respawn can be automatically executed after the terminal monitoring program in the wait program exits, the terminal monitoring program can be automatically restarted, the condition that the terminal monitoring program can be restarted after an administrator is required to verify and log in after the terminal program exits can be avoided, and the purpose of improving the usability of equipment can be further realized.
On the other hand, the automatic restart program respawn of the system is changed into a self-defined program, the starting times of the terminal monitoring program can be checked in the self-defined program, when the starting times of the terminal monitoring program exceed a preset threshold value, the system can stop the terminal monitoring program, start the login verification program and wait for the processing of a system administrator, so that the situation that a console port cannot perform any operation due to the fact that the system is busy in a state of infinitely restarting the terminal monitoring program when the terminal monitoring program has serious faults can be avoided, and the purpose of improving the usability of equipment can be achieved.
Drawings
FIG. 1 is a flowchart illustrating an initialization method of a Linux system according to an exemplary embodiment of the present application;
fig. 2 is a hardware structure diagram of a terminal device carrying a Linux system where an initialization apparatus of the Linux system is according to an exemplary embodiment of the present application;
fig. 3 is an initialization apparatus of a Linux system according to an exemplary embodiment of the present application.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this application and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It is to be understood that although the terms first, second, third, etc. may be used herein to describe various information, such information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the present application. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.
In the related art, the Linux system may perform system initialization by using a/etc/inittab file, where the content of the file is as follows:
::sysinit:/etc/init.d/sysinit
::wait:-/usr/bin/startup
::respawn:/sbin/agetty
the Linux system program is divided into a kernel mode program and a user mode program. The kernel-state program can exist for a long time, and if a fault occurs, the Linux system is crashed and restarted, so that the life cycle of the kernel-state program can be considered as equal to that of the system.
When the Linux system is started, the kernel mode program is initialized first, then the/etc/inittab file is parsed, and the sysinit specified program is started, which can be generally used for the initialization of the file system. Then starting a program specified by wait, wherein the program can be generally used for recovering the configuration of the user mode module, and then starting a terminal monitor program which manages a console port; the console port is a common control port of a network/security device, and can be connected with the console port and the PC of the device by using a dedicated connection line, and then the console port can be taken over by a terminal simulation program of the PC terminal to manage the device, and the management interface is a command line interface. After the terminal monitor is started, the user can only execute the commands provided by the terminal monitor, but cannot execute the commands (such as ls, mv, rm, and the like) provided by the terminal monitor (such as a shell) of the Linux system.
When the terminal monitor exits for some reason (for example, the process crashes due to a failure, or is actively stopped by a kernel-state program, and the system maintenance personnel needs to restart the process in order to repair a local failure of the process), the program represented by the resume line is started, the program is generally a console login verification program (for example, agent), after the terminal program exits, the system is automatically switched to the program, in this case, the console port of the device and the PC need to be connected by a dedicated connection line through an administrator, the console port needs to be taken over by a terminal simulation program at the PC, then a login verification interface is displayed at the PC, the login is verified by using a user account and a password, and the terminal monitor program is restarted.
On one hand, after the terminal monitoring program exits, the PC and the console port of the device must be connected through a dedicated connection line, then the console port is connected through the terminal simulation program of the PC, and then a login verification interface is displayed on the PC, so that the management can perform login verification operation and recover the operation of the terminal monitoring program. Wherein, the availability is the probability that the system or a specific program can normally operate within a certain investigation time or the expected value of the time occupancy.
On the other hand, although the terminal listener is not exited, the process does not respond for some reason (for example, is attacked by a specific message), and the process cannot be operated through the console port, telnet, SSH (Secure Shell protocol), and the like.
In order to solve the problems in the related art, the application provides an initialization method of a Linux system, which is applied to terminal equipment carrying the Linux system, and a kernel mode program terminates a terminal monitor when the terminal monitor loses response; when the terminal monitoring program exits, the system automatically runs the respawn program; then, the respawn program judges whether the starting times of the terminal monitoring program in a preset period reach a preset threshold value; if the starting times reach a preset threshold value, starting a login verification program; and if the starting times do not reach the preset threshold value, restarting the terminal monitoring program.
On one hand, the automatic restart program of the system is changed into the self-defined respaw program, and the self-defined respaw program can start the terminal monitoring program, so that the program in the respaw can be automatically executed after the terminal monitoring program in the wait exits, and the terminal monitoring program can be automatically restarted, so that the condition that the terminal monitoring program can be restarted after the terminal program exits and an administrator is required to verify and log in can be avoided, and the purpose of improving the usability of equipment can be realized.
On the other hand, the automatic restart program respawn of the system is changed into the self-defined respawn program, the starting times of the terminal monitoring program can be checked in the self-defined respawn program, when the starting times of the terminal monitoring program exceed the preset threshold value, the system can terminate the terminal monitoring program, start the login verification program and wait for the processing of a system administrator, so that the situation that the system is busy in the state of infinitely restarting the terminal monitoring program to cause that the console port cannot carry out any operation when the terminal monitoring program has serious faults can be avoided, and the purpose of improving the usability of the equipment can be realized.
In addition, whether the terminal monitor is in a non-response state or not is judged by detecting whether the survival information periodically sent by the terminal monitor is received or not within the timing time through the kernel mode program. When the terminal monitor program is in a non-response state, the kernel-state program can terminate the terminal monitor program, and the terminal monitor program is automatically restarted through respawn, so that the condition that the terminal monitor program cannot provide service for a long time when the terminal monitor process has no response can be avoided, and the purpose of improving the equipment availability can be realized.
Referring to fig. 1, fig. 1 is a flowchart of an initialization method of a Linux system according to an exemplary embodiment of the present application, which is applied to a terminal device equipped with the Linux system, where a program specified by a respaw in an inittab file of the Linux system is modified into a custom respaw program (hereinafter, respaw program), and the following steps are specifically executed:
step 101: when the terminal monitoring program loses response, the kernel mode program terminates the terminal monitoring program; when the terminal monitoring program exits, the system automatically runs the respawn program;
step 102: the respawn program judges whether the starting times of the terminal monitoring program in a preset period reach a preset threshold value or not;
step 103: if the starting times reach a preset threshold value, starting a login verification program; and if the starting times do not reach the preset threshold value, restarting the terminal monitoring program.
In this embodiment, in order to avoid the problem of service interruption caused by the terminal monitor being unable to automatically restart after the terminal monitor exits abnormally, an initialization procedure of the existing Linux-based operating system may be modified, specifically, a login verification program specified by respawn in an inittab file of the Linux system may be modified into the terminal monitor.
For example, taking the Linux-based derivative operating system, Conplat, in which the terminal monitor is the Consplat _ cli, the sequence of respawn:/sbin/agent may be modified to respawn:/respawn _ conti, and when the Linux system is initialized, sysinit:/etc/init.d/sysinit is executed first, and after the program of the sysinit row is executed, wait:/usr/bin/startup is executed, and then the terminal monitor can take over the console port.
When the terminal listener exits due to some abnormal reasons (including forced termination by a kernel-mode program or a fault that causes self-termination of the terminal listener, such as a memory access error), in such a case, the system may automatically execute a program specified by respown, that is, the terminal listener. Therefore, the terminal monitoring program can be prevented from being restarted after the terminal program exits and the administrator is required to perform verification and login, and the purpose of improving the equipment usability can be achieved.
However, considering that the terminal listener itself may have a serious fault and cannot be started under a specific condition, the system is busy with infinitely restarting the terminal listener, so that the console port cannot perform any operation, and since the automatic restart of the terminal listener is automatically restarted by the system itself, the administrator cannot terminate, and once such a fault occurs, the system loses response and cannot manage.
In order to solve the above problem, the program designated by respawn may be modified to have a function of detecting the number of times the terminal listens to the start of the program.
When the initialization process of the Linux system runs to a program specified by respaw, the terminal monitoring program can be automatically restarted, then the respaw program can check whether the starting frequency of the terminal monitoring program reaches a preset threshold value or not since the system is started, when the starting frequency of the terminal monitoring program reaches the preset threshold value, the respaw program can terminate the automatic restart of the terminal monitoring program, the automatic restart is converted into a starting login verification program, and after a system administrator performs login verification and solves the problem, the automatic restart process of the terminal monitoring program is recovered.
For example, taking the Linux-based derivative operating system, in the conplay operating system, the terminal listener is a contit _ cli, and when the concst _ cli is implemented, the terminal listener can be modified to have a function of checking the boot frequency, the modified terminal listener is a contit _ respawn, a program specified by the respawn can be modified to be the terminal listener, and the boot frequency of the terminal listener can be checked through the modified terminal listener.
In an embodiment shown, the preset threshold may be a ratio of a duration corresponding to the preset period to a sum of a duration required for starting the terminal monitor and a duration for manually terminating the automatic restart of the terminal monitor by an administrator. The preset period is used for an inspection process of automatic restart of the terminal monitoring program.
When setting the threshold, whether the time length from the current start to the next start of the terminal monitor is enough to allow a system administrator to actively terminate the automatic restart of the terminal monitor through a command line needs to be considered, so that the duration of the automatic restart should be as short as possible, so that the administrator can terminate the automatic restart of the terminal monitor as soon as possible; also considering the problem of the availability of the device, if the preset threshold is small, it may cause the termination of the terminal listener after several occasional restarts, which may reduce the availability of the device, and therefore the preset threshold may not be too high, otherwise the administrator may not terminate the terminal listener by hand, nor too low, otherwise the availability of the device may be reduced.
For example, if the preset period is 600 seconds, the terminal listener start time needs 10 seconds, and the administrator manually terminates the automatic restart of the terminal listener time needs 20 seconds, the preset threshold cannot exceed 20[600/(10+20) ] times.
In an embodiment shown, when counting the number of times of automatic restart of the terminal monitor, a block of memory may be applied in the memory of the Linux system for storing the start time of the terminal monitor, where the block of memory may be in a kernel mode program or an independent memory at any position of a terminal device carrying the Linux system.
After the terminal monitor is started, the kernel mode program may generate a time record corresponding to the start time of the terminal monitor, add the start time record to the memory, and then count the number of times of starting the terminal monitor based on the number of time records recorded in the memory.
In this embodiment, after counting the number of times of starting the terminal monitor, the respawn procedure can determine whether the number of times of starting the terminal monitor reaches a preset threshold value in a preset period. If the starting times of the terminal monitoring program reach a preset threshold value, the restarting times of the terminal monitoring program are frequent at the moment, and the terminal monitoring program is likely to be infinitely restarted due to the fact that serious faults may exist in the terminal monitoring program, under the condition, the automatic restarting process of the terminal monitoring program can be stopped, and the login verification program can be started immediately; of course, if the number of times of starting the terminal monitor does not reach the preset threshold, the restart process of the terminal monitor can be normally executed, and the terminal monitor can be restarted.
In an embodiment shown, when the automatic restart process of the terminal monitor is terminated and the login verification program is started, the kernel-state program may further empty the generated time record corresponding to the time when the terminal monitor is started, and after the administrator repairs the fault, the terminal monitor may be restarted through the login verification and enter the next cycle.
Of course, except that the administrator manually terminates the automatic restart of the terminal monitor through the command line, and the respaw program terminates the automatic restart of the terminal monitor when the startup frequency of the terminal monitor reaches the preset threshold, the generated time record corresponding to the startup time of the terminal monitor can be also recorded and emptied after the whole Linux system is restarted.
In this case, besides the problem of the above-described unlimited restart, the terminal monitor program may also have an abnormal problem that the terminal monitor process has no response for unknown reasons. For this case, the following measures may be taken.
In one embodiment, the terminal listener may periodically send a survival signal to the kernel-mode program based on a preset period, where the preset period is used to determine whether the terminal listener is abnormal. Then, the kernel mode program may start a timer, and check whether the survival signal sent by the terminal monitor is received within a preset time period, and if the survival signal sent by the terminal monitor is not received within the preset time period, it may be determined that the terminal monitor is abnormal.
For example, if the preset period for the terminal listener to periodically send the alive signal to the kernel mode is 10 seconds, and the time duration for the kernel mode program to start is 100 seconds, the kernel mode program may determine that the terminal listener is abnormal if the kernel mode program does not receive the alive message sent by the terminal listener within the 100 seconds.
In an embodiment shown, when the kernel-state program determines that the terminal monitor program is abnormal, the kernel-state program may terminate the terminal monitor program, and then the kernel-state program may execute a custom reset-specified program to restart the terminal monitor program, and recover an automatic restart flow of the terminal monitor program.
According to the technical scheme provided by the application, when the terminal monitor loses response, the kernel mode program terminates the terminal monitor; when the terminal monitoring program exits, the system automatically runs the respawn program to restart the terminal monitoring program; then, the respawn program judges whether the starting times of the terminal monitoring program in a preset period reach a preset threshold value; if the starting times reach a preset threshold value, starting a login verification program; and if the starting times do not reach the preset threshold value, restarting the terminal monitoring program.
On one hand, the automatic restart program of the system is changed into the self-defined respaw program, and the self-defined respaw program can start the terminal monitoring program, so that the program in the respaw can be automatically executed after the terminal monitoring program in the wait exits, and the terminal monitoring program can be automatically restarted, so that the condition that the terminal monitoring program can be restarted after the terminal program exits and an administrator is required to verify and log in can be avoided, and the purpose of improving the usability of equipment can be further realized.
On the other hand, the automatic restart program respawn of the system is changed into the self-defined respawn program, the starting times of the terminal monitoring program can be checked in the self-defined respawn program, when the starting times of the terminal monitoring program exceed the preset threshold value, the system can terminate the terminal monitoring program, start the login verification program and wait for the processing of a system administrator, so that the situation that the system is busy in the state of infinitely restarting the terminal monitoring program to cause that the console port cannot carry out any operation when the terminal monitoring program has serious faults can be avoided, and the purpose of improving the usability of the equipment can be realized.
In addition, whether the terminal monitor is in a non-response state or not is judged by detecting whether the survival information periodically sent by the terminal monitor is received or not within the timing time through the kernel mode program. When the terminal monitor program is in a non-response state, the kernel-state program can terminate the terminal monitor program and automatically restart the terminal monitor program through respawn, so that the situation that the terminal monitor program cannot provide service for a long time when the terminal monitor process is blocked can be avoided, and the purpose of improving the equipment availability can be realized.
Corresponding to the foregoing embodiment of the initialization method of the Linux system, the present application further provides an embodiment of an initialization apparatus of the Linux system.
The embodiment of the initialization device of the Linux system can be applied to terminal equipment carrying the Linux system. The device embodiments may be implemented by software, or by hardware, or by a combination of hardware and software. Taking a software implementation as an example, as a device in a logical sense, the device is formed by reading a corresponding computer program instruction in a nonvolatile memory into an internal memory for running through a processor of a terminal device where the terminal device is mounted with a Linux system. In terms of hardware, as shown in fig. 2, the present application is a hardware structure diagram of a terminal device carrying a Linux system where an initialization apparatus of the Linux system is located, except for the processor, the memory, the network interface, and the nonvolatile memory shown in fig. 2, the terminal device carrying the Linux system where the apparatus is located in the embodiment may also include other hardware according to the actual function of the initialization apparatus of the Linux system, which is not described again.
Referring to fig. 3, fig. 3 is a flowchart illustrating an initialization apparatus of a Linux system according to an exemplary embodiment of the present application, applied to a terminal device equipped with the Linux system, where a program specified by a respaw in an inittab file of the Linux system is modified into a custom respaw program (hereinafter, respaw program), and the apparatus includes: an operation unit 310, a judgment unit 320 and an execution unit 330.
The running unit 310 is configured to, when the terminal monitor loses response, terminate the terminal monitor by the kernel-mode program; when the terminal monitoring program exits, running the program specified by the respawn;
a determining unit 320, configured to determine, by the respawn program, whether the number of times of starting the terminal monitoring program in a preset period reaches a preset threshold;
an executing unit 320, configured to start a login verification program if the number of times of starting reaches a preset threshold; and if the starting times do not reach the preset threshold value, restarting the terminal monitoring program.
In this example, the apparatus further comprises:
the checking unit is used for starting a timer by the kernel mode program and checking whether the survival signal sent by the terminal monitoring program is received within a preset time length;
and the determining unit is used for determining that the terminal monitor program is abnormal if the survival signal sent by the terminal monitor program is not received within the preset time length.
The generating unit is used for generating a time record corresponding to the starting time of the terminal monitoring program when the terminal monitoring program is started;
and the counting unit is used for counting the starting times of the terminal monitoring program based on the number recorded at the moment.
And the emptying unit is used for emptying the generated time record corresponding to the starting time of the terminal monitoring program.
Wherein the preset threshold is: and the ratio of the time length corresponding to the preset period to the sum of the time length required by starting the terminal monitoring program and the time length for stopping the automatic restart of the terminal monitoring program manually by an administrator.
The implementation process of the functions and actions of each unit in the above device is specifically described in the implementation process of the corresponding step in the above method, and is not described herein again.
For the device embodiments, since they substantially correspond to the method embodiments, reference may be made to the partial description of the method embodiments for relevant points. The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of the application. One of ordinary skill in the art can understand and implement it without inventive effort.
The above description is only exemplary of the present application and should not be taken as limiting the present application, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the scope of protection of the present application.

Claims (10)

1. An initialization method of a Linux system is applied to a terminal device carrying the Linux system, and is characterized in that a program specified by respaw in an inittab file of the Linux system is modified into a self-defined respaw program, and the method comprises the following steps:
when the terminal monitoring program loses response, the kernel mode program terminates the terminal monitoring program and starts the program specified by the respawn; when the terminal monitoring program exits, the system automatically runs the program specified by the respawn;
the respawn program judges whether the starting times of the terminal monitoring program in a preset period reach a preset threshold value or not;
if the starting times reach a preset threshold value, starting a login verification program; and if the starting times do not reach the preset threshold value, restarting the terminal monitoring program.
2. The method according to claim 1, wherein the terminal monitor periodically sends a survival signal to the kernel-state program based on a preset period;
the method further comprises the following steps:
the kernel mode program starts a timer and checks whether the survival signal sent by the terminal monitoring program is received within a preset time length;
and if the survival signal sent by the terminal monitor is not received within the preset time length, determining that the terminal monitor is abnormal.
3. The method according to claim 1, wherein before determining whether the number of times of starting the terminal listener in the preset period reaches a preset threshold, the method further comprises:
when the terminal monitoring program is started, generating a time record corresponding to the starting time of the terminal monitoring program;
and counting the starting times of the terminal monitoring program based on the number recorded at the moment.
4. The method according to claim 1, wherein the preset threshold is:
and the ratio of the time length corresponding to the preset period to the sum of the time length required by starting the terminal monitoring program and the time length for stopping the automatic restart of the terminal monitoring program manually by an administrator.
5. The method of claim 1, wherein after initiating a login authentication procedure, the method further comprises:
and clearing the generated time record corresponding to the time of starting the terminal monitoring program.
6. An initialization device of a Linux system, applied to a terminal device carrying the Linux system, wherein a program specified by respaw in an inittab file of the Linux system is modified into a custom respaw program, comprising:
the running unit is used for stopping the terminal monitoring program by the kernel-mode program and starting the program specified by the respawn when the terminal monitoring program loses response; when the terminal monitoring program exits, running the program specified by the respawn;
the judging unit is used for judging whether the starting times of the terminal monitoring program in the preset period reach a preset threshold value by the respawn program;
the execution unit is used for starting a login verification program if the starting times reach a preset threshold value; and if the starting times do not reach the preset threshold value, restarting the terminal monitoring program.
7. The apparatus of claim 6, wherein the terminal monitor periodically sends a survival signal to the kernel-state program based on a preset period; the device further comprises:
the checking unit is used for starting a timer by the kernel mode program and checking whether the survival signal sent by the terminal monitoring program is received within a preset time length;
and the determining unit is used for determining that the terminal monitor program is abnormal if the survival signal sent by the terminal monitor program is not received within the preset time length.
8. The apparatus of claim 6, further comprising:
the generating unit is used for generating a time record corresponding to the starting time of the terminal monitoring program when the terminal monitoring program is started;
and the counting unit is used for counting the starting times of the terminal monitoring program based on the number recorded at the moment.
9. The apparatus of claim 6, wherein the preset threshold is:
and the ratio of the time length corresponding to the preset period to the sum of the time length required by starting the terminal monitoring program and the time length for stopping the automatic restart of the terminal monitoring program manually by an administrator.
10. The apparatus of claim 6, further comprising:
and the emptying unit is used for emptying the generated time record corresponding to the starting time of the terminal monitoring program.
CN201610864312.6A 2016-09-29 2016-09-29 Initialization method and device of Linux system Active CN106406963B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610864312.6A CN106406963B (en) 2016-09-29 2016-09-29 Initialization method and device of Linux system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610864312.6A CN106406963B (en) 2016-09-29 2016-09-29 Initialization method and device of Linux system

Publications (2)

Publication Number Publication Date
CN106406963A CN106406963A (en) 2017-02-15
CN106406963B true CN106406963B (en) 2020-09-08

Family

ID=59228923

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610864312.6A Active CN106406963B (en) 2016-09-29 2016-09-29 Initialization method and device of Linux system

Country Status (1)

Country Link
CN (1) CN106406963B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112148548B (en) * 2019-06-27 2023-08-08 北京百度网讯科技有限公司 Method, device and equipment for determining starting times
CN114077519B (en) * 2020-08-21 2022-11-18 荣耀终端有限公司 System service recovery method and device and electronic equipment
CN114827154A (en) * 2021-01-18 2022-07-29 网宿科技股份有限公司 Port monitoring method, system and server

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101064712A (en) * 2006-04-24 2007-10-31 维豪信息技术有限公司 System and method for realizing Linux inner core based dual-channel through multistage NAT and fireproof wall
US8407787B1 (en) * 2009-01-22 2013-03-26 Trend Micro Incorporated Computer apparatus and method for non-intrusive inspection of program behavior
CN105302611A (en) * 2015-11-13 2016-02-03 中标软件有限公司 Method and system for starting computer system under Linux

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101064712A (en) * 2006-04-24 2007-10-31 维豪信息技术有限公司 System and method for realizing Linux inner core based dual-channel through multistage NAT and fireproof wall
US8407787B1 (en) * 2009-01-22 2013-03-26 Trend Micro Incorporated Computer apparatus and method for non-intrusive inspection of program behavior
CN105302611A (en) * 2015-11-13 2016-02-03 中标软件有限公司 Method and system for starting computer system under Linux

Also Published As

Publication number Publication date
CN106406963A (en) 2017-02-15

Similar Documents

Publication Publication Date Title
KR101540129B1 (en) Remote access diagnostic device and methods thereof
CN110928743B (en) Computing system, automatic diagnosis method and medium storing instructions thereof
CN109510742B (en) Server network card remote test method, device, terminal and storage medium
US9665452B2 (en) Systems and methods for smart diagnoses and triage of failures with identity continuity
CN106020865A (en) System upgrading method and device
CN106406963B (en) Initialization method and device of Linux system
US10445503B2 (en) Secure persistent software updates
JP2009514042A (en) Network device and method for monitoring startup of such devices
US9798606B2 (en) Systems and methods for smart diagnosis using hosted resources with intelligent altering of boot order
US20140013428A1 (en) Apparatus and method for managing operation of a mobile device
US7278048B2 (en) Method, system and computer program product for improving system reliability
WO2012000328A1 (en) Multimedia terminal device and maintenance method thereof
CN114116280A (en) Interactive BMC self-recovery method, system, terminal and storage medium
US9465643B1 (en) Systems and methods for monitoring a primary operating system (OS) and/or migrating data using an OS hypervisor
CN113742120B (en) Kdump triggering method, system, equipment and medium
CN113806811A (en) Method and device for automatically recovering tampered firmware and storage medium
CN115562900B (en) AMD server system installation power-off processing method, device, equipment and medium
CN110471814B (en) Control method for error reporting function of server device
CN111400113B (en) Complete machine self-checking method, device and system of computer system
CN105511848A (en) Method and device for detecting DLL
CN111400094A (en) Method, device, equipment and medium for restoring factory settings of server system
CN111475339A (en) BIOS firmware updating method, device, equipment and storage medium
CN111327722B (en) Conflict detection method, system, terminal and storage medium for static IP and dynamic IP
CN115686914A (en) Fault recording method, computing device and storage medium
CN118233281A (en) Test method, device, equipment and medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
CB02 Change of applicant information
CB02 Change of applicant information

Address after: Binjiang District and Hangzhou city in Zhejiang Province Road 310051 No. 68 in the 6 storey building

Applicant after: Hangzhou Dipu Polytron Technologies Inc

Address before: Binjiang District and Hangzhou city in Zhejiang Province Road 310051 No. 68 in the 6 storey building

Applicant before: Hangzhou Dipu Technology Co., Ltd.

C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant