CN114860326A - Operating system application service management system and application service management method thereof - Google Patents

Operating system application service management system and application service management method thereof Download PDF

Info

Publication number
CN114860326A
CN114860326A CN202210780837.7A CN202210780837A CN114860326A CN 114860326 A CN114860326 A CN 114860326A CN 202210780837 A CN202210780837 A CN 202210780837A CN 114860326 A CN114860326 A CN 114860326A
Authority
CN
China
Prior art keywords
application service
module
service
command line
user
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.)
Granted
Application number
CN202210780837.7A
Other languages
Chinese (zh)
Other versions
CN114860326B (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.)
Kirin Software Co Ltd
Original Assignee
Kirin Software 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 Kirin Software Co Ltd filed Critical Kirin Software Co Ltd
Priority to CN202210780837.7A priority Critical patent/CN114860326B/en
Publication of CN114860326A publication Critical patent/CN114860326A/en
Application granted granted Critical
Publication of CN114860326B publication Critical patent/CN114860326B/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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3065Monitoring arrangements determined by the means or processing involved in reporting the monitored data
    • 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/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • 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/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Quality & Reliability (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)

Abstract

The invention relates to an application service management system and method of an operating system, wherein the system runs between a system service and an application service and is used for a user to inquire and manage the application service; the system comprises an application service loading module, an application service monitoring module, a command line interaction module and a Web management function module, wherein the application service loading module is used for reading a configuration file of an application service and starting the application service; the application service monitoring module is used for recording and monitoring the running state and the corresponding log of the application service; the command line interaction module is used for receiving a command of a user to the application service and finishing interaction; the Web management function module is used for providing an interface for a user to remotely control and manage the application service. The invention isolates the system service and the application service, so that the user can configure the application service without knowing the core service of the operating system, and meanwhile, the user can not see the core service of the system when looking up the state of the application service, thereby improving the user friendliness of the system.

Description

Operating system application service management system and application service management method thereof
Technical Field
The invention relates to the technical field of operating system application service management, in particular to an operating system application service management system and an application service management method thereof.
Background
On various existing linux operating systems, there are SysVinit and systemd as the starting mode of the service. They are the first program started by the linux kernel to start taking over the system.
The SysVinit determines the starting level by starting up and reading/etc/inittab, and then starts up the script files under the directories of/etc/rc.d/rc and/etc/rc.d/rcX.d (0-6) to run the service processes of the system one by one.
Systemd starts system services one by starting a daemon of the system and then/etc/Systemd/system/etc/Systemd/user and/lib/Systemd/system// lib/Systemd/user.
The various services launched in SysVinit and system are the core services of the os, and these core services, while it is not necessary for the user to know and configure it, he is part of the os but should not let all the people using the os know it
If a user installs an application, in existing systems, the application will install the service under the framework of SysVinit/systemd. If the application crashes on any day, the user can only look for and repair the framework in the SysVinit/systemd framework, which can force the user to see many system core services that he does not know about.
The existing service management has the following defects:
1. the existing service management is based on the system itself, and if a user inquires about the application service state (systemctl status), a pile of unknown services can be easily seen, so that the system is not friendly to the user.
2. When an application requires multiple versions of a program to run, a traditional service such as system has no way to do so unless the service file is overwritten.
3. Existing service management such as system does not have a good way to remotely observe and manage services (web-based) and therefore cannot provide for the querying and deployment of modular services in multiple network topologies.
Disclosure of Invention
In order to solve the difference existing in the prior art, the invention provides an application service management system of an operating system, wherein the application service management system runs between system service and application service and is used for a user to inquire and manage the application service;
the application service management system comprises an application service loading module, an application service monitoring module, a command line interaction module and a Web management function module, wherein,
the application service loading module is used for reading a configuration file of the application service and starting the application service;
the application service monitoring module is connected with the application service loading module and the command line interaction module and is used for monitoring the running state of the application service and recording a corresponding log of the application service;
the command line interaction module is used for receiving a command of a user to the application service and finishing interaction; the Web management function module is connected with the application service, the application service loading module, the application service monitoring module and the command line interaction module and is used for providing an interface for a user to remotely control and manage the application service.
The command line interaction module manages corresponding application services through the following command lines:
obtaining the state of the corresponding application service through a command line of 'usd status + corresponding application service';
starting the corresponding application service through a command line of 'usd start + corresponding application service';
closing the corresponding application service through a command line of 'usd stop + corresponding application service';
reloading the configuration file of the corresponding application service through a command line of 'usd load + corresponding application service';
and restarting the corresponding application service through a command line of 'usd restart + corresponding application service'.
The application service loading module analyzes the contents of all files in a data structure one by reading/etc/userpace/userpace.d/catalog and starts application service in a form of fork/exec;
the application service monitoring module polls, inquires and monitors the process state of the application service under proc/pid by recording the pid for starting the application service process, thereby determining whether the application service is normally operated;
and under the condition that the application service is abnormally operated, whether the application service is restarted or not is determined by reading the configuration file read by the application service loading module.
The application service monitoring module redirects the output of the stdout and stderr to a log file to realize the recording of the log corresponding to the application service.
And the operating system application service management system is installed and operated between the system service and the application service through an apt command.
The invention also provides an application service management method based on any one of the operating system application service management systems, which comprises the following steps:
step S1: writing usd-based configuration files for application services;
step S2: reloading the configuration file of the application service by using a usd reload command line;
step S3: starting application service in a fork/exec mode; recording pid information and corresponding structural body data of the pid information, and monitoring the running state of the application service by inquiring and monitoring the process state under proc/pid;
step S4: outputting and redirecting to a log file through stdout and stderr so as to record a corresponding log of the application service;
step S5: when the application service is abnormal, whether the application service is restarted or quitted is judged according to the information of the application service configuration file, and the relevant information of the abnormal operation of the application service is notified to a user.
In step S1, the configuration file of the application service is written in a key value pair-yaml file manner.
In step S2, the configuration file of the application service is loaded in the/etc/userpace.
In step S3, the application service is started by any one of a sub-process, direct running, single running, or idle running.
The operating system application service management system and the operating system application service management method provided by the invention isolate system services and application services, so that a user can configure own application services without knowing the core services of the operating system, and meanwhile, the core services of the system can not be seen when the application service state is checked, thereby improving the user friendliness of the system.
Drawings
FIG. 1: the existing start-up process of SysVinit.
FIG. 2: the starting process of the system is already available.
FIG. 3: the invention provides a logic framework diagram of an application service management system.
FIG. 4: the invention provides another detailed logic framework diagram of the application service management system.
FIG. 5: and the Web management function module can realize the interaction function.
FIG. 6: a functional logic diagram of a command line interaction module.
FIG. 7: and the application service monitoring module and the application service loading module are used for monitoring the functional logic diagram.
FIG. 8: the invention discloses a schematic diagram of an installation starting program of an application service management system.
FIG. 9: and the application service monitoring module realizes a logic diagram of a log recording function.
Detailed Description
In order to further understand the technical scheme and the advantages of the present invention, the following detailed description of the technical scheme and the advantages thereof is provided in conjunction with the accompanying drawings.
Aiming at the difference of the prior art, in order to meet the user friendliness of the operating system, the invention develops an application service management method of the operating system, which is based on system and takes over all application services. When the user manages the application program, the core service of the operating system is not needed or needed.
Fig. 3 is a logic framework diagram of the application service management system provided by the present invention, the present invention operates a service for providing user use on the system md/SysVinit, the application management service is a set of service existing with the system itself, if the system md is the system md, the present invention establishes a userpace service by itself, if the system md is the SysVinit, the present invention establishes a userpace service by itself, under the application management service of the present invention, the application programs and services queried by the client through the corresponding management command both exclude the system core service, thereby greatly improving the user friendliness.
Fig. 4 is another detailed logic framework diagram of the application service management system provided in the present invention, as shown in fig. 4, the application service management system runs between the system service and the application service, and is used for the user to query and manage the application service; the application service management system comprises an application service loading module, an application service monitoring module, a command line interaction module and a Web management function module.
The functions or operation modes of the modules can be detailed in conjunction with fig. 4 and fig. 5-7, respectively.
1. Web management function module
The Web management function module is used as a basic interface for realizing interaction among the application service loading module, the application service monitoring module, the command line interaction module and the application service, is connected with the application service loading module, the application service monitoring module and the command line interaction module, and is used for remotely connecting and configuring system services and providing an interface for a user to remotely control and manage the application service.
Fig. 5 shows an interactive function that can be implemented by the Web management function module, which mainly includes several basic functions of querying logs, querying states, querying all services, stopping and restarting services, and the like.
2. Command line interaction module
FIG. 6 is a functional logic diagram of a command line interaction module that provides Shell functionality for command line interaction with application services; specifically, the shell function manages the corresponding application service by using the following command lines:
obtaining the state of the corresponding application service through a command line of 'usd status + corresponding application service';
starting the corresponding application service through a command line of 'usd start + corresponding application service';
closing the corresponding application service through a command line of 'usd stop + corresponding application service';
reloading the configuration file of the corresponding application service through a command line of 'usd load + corresponding application service';
and restarting the corresponding application service through a command line of 'usd restart + corresponding application service'.
3. Application service monitoring module and application service loading module
Fig. 7 is a functional logic diagram of an application service monitoring module and an application service loading module, where the loading service mainly analyzes contents of all files in a read/etc/userpace/userpace.d/directory one by one into a data structure, and starts the application service in a fork/exec manner, and specifically, the application service can be started in four manners of sub-process/direct operation/single operation/idle operation. Then, recording the pid (i.e. process number process id) of the starting process, monitoring the running state of the fork/exec process under the proc/pid (directory where the process number is located) through polling query, redirecting to a log file through stdout and stderr output, and recording a corresponding log of the application service, thereby determining whether the application program runs normally.
The method comprises the steps that a configuration file related to application service is arranged under an application service/etc/userplaced/userpace.d/directory, measures such as restarting, informing or quitting when the application program runs abnormally are configured in the configuration file, when the application program running abnormally is monitored, whether the application service is restarted or quitted is determined by reading configuration information in the configuration file, and information of the application service running abnormally is informed to a user through a Web management function module.
After monitoring that the application service is abnormal in operation, the application service monitoring module automatically triggers restarting, informing or quitting operation by codes in the application service management system; different from the operations of restarting, closing and the like completed by the command line interaction module, the operations of restarting, closing and the like realized by the command line interaction module are manually triggered by a user, and the aim is to facilitate a maintainer to manage or debug own application service.
The application service management system provided by the invention has the following implementation method or use method:
1. first, please refer to fig. 8, which is a schematic diagram of an installation start program of the application service management system of the present invention: and installing the application service management system through the apt command.
2. After that, the userspaced daemon is started.
3. An usd-based application service profile is written.
Since the existing application program only needs to start one instance, other instances can be completed in a sub-process mode. If the database under multiple versions needs to be operated, an alternative installer needs to be additionally used under the original Linux system, otherwise, only one version can be installed by default. The application service management system of the invention is software installed through apt install, and in order to perfectly support (simultaneously start multiple versions) and classify (uniformly manage all services), the configuration file of the invention is embodied in a key value pair (yaml file) mode.
An example is as follows
test # indicates the name of the user service, whose status can be subsequently checked by the usd status test
dir: # indicates the directory address where the real executable file exists
- /usr/bin/
name: # indicates the actual executable file name
- program
cmd: # indicates parameter of executable file
- --help
Log: # indicates the log file for standard export and standard error redirection of the user program
- /tmp/program.log
user: # indicates that the program is run with kylin users
- kylin
env: # indicates the environment variable for running extra bands of the program
- PATH=$PATH
type: # indicates the mode of running the user service
- fork/exec/oneshot/idle
autorestart # indicates whether to restart the service when the service exits
- on/off
It can be seen that in the present invention, when an application requires multiple versions of a program to run, a traditional service such as system has no way to do so unless the service file is overwritten, however, the present invention can support multiple sets of configurations through the yaml file, resulting in one yaml being able to launch multiple instances.
The yaml format file configured by the invention is read and analyzed through the following processes: and loading the yaml file at the specified position through a function load _ file, reading the yaml data into the structure body through a function get _ struct, closing the opened yaml file through a function close _ file, starting a thread, and reloading the data in the yaml through a reload _ file function if the change of the yaml is detected.
4. The configuration file written above is stored in the/etc/userpace/userpace.d/directory, and then the service can be reloaded by using a usd reload command.
5. Starting the application service, recording pid information and corresponding structural body data, adding the application service into a circular queue, monitoring the process state under proc/pid by polling query, and continuously polling the state of the application service, wherein the process is shown in the figure 7.
6. For each started application service, the service is redirected to a log file through stdout and stderr output at the same time, as shown in fig. 9, so that the problem is conveniently referred.
7. When the application service operation is abnormal, whether the application service is restarted or quitted is judged by reading the configuration file, and relevant information of the abnormal application service operation is notified to a user.
The invention has the following beneficial effects:
1. the system service and the application service are isolated, so that a user can configure the application service without knowing the core service of the operating system, and meanwhile, the core service of the system can not be seen when the state of the application service is checked, and the user friendliness of the system is improved;
2. an inquiry and management interface of the application service is provided in a web mode, so that a user can remotely monitor, inquire and manage all the application services through a web page, which cannot be realized by a system;
3. the application service is configured, added, modified and deleted in a key value pair (yaml file) mode, and compared with a service file for writing system, the configuration is simpler and the service deployment is more convenient;
4. for starting application service, a single log file exists, and compared with a systemd-journald log, the log information is more convenient to check;
5. and for all user services, one-click closing, starting or restarting of all services can be realized through the Web management function module. This functional system is not available.
In the invention, the name "/sbin/init" is the first program loaded after the kernel of the operating system is started, and the name of the directory under the sbin is called init.
In the present invention, the service management framework used by the earlier operating system is referred to as "SysVinit".
In the present invention, the "Systemd" is a service management framework used by a new operating system, and is more powerful than sysvinit.
In the invention, the Web webpage refers to a started local http webpage, which occupies a port and can be accessed through a browser.
In the invention, the "daemon process" refers to an application program which is always operated in the background of the system.
In the present invention, the "Shell function" refers to an application program preset by an operating system for character interaction, where the Shell function refers to a function provided by a program for performing character interaction through a command line.
In the present invention, the term "Yaml file" refers to a file format.
In the present invention, the term "Fork" refers to creating a new process, and the new process is a sub-process.
In the present invention, the term "Exec" refers to direct operation, and a specific executable binary is directly operated in the created sub-process environment.
Although the present invention has been described with reference to the preferred embodiments, it should be understood that the scope of the present invention is not limited thereto, and those skilled in the art will appreciate that various changes and modifications can be made without departing from the spirit and scope of the present invention.

Claims (9)

1. An operating system application service management system, characterized by: the application service management system runs between the system service and the application service, and is used for a user to inquire and manage the application service;
the application service management system comprises an application service loading module, an application service monitoring module, a command line interaction module and a Web management function module, wherein,
the application service loading module is used for reading a configuration file of the application service and starting the application service;
the application service monitoring module is connected with the application service loading module and used for monitoring the running state of the application service and recording a corresponding log of the application service;
the command line interaction module is used for receiving a command of a user to the application service and finishing interaction;
the Web management function module is connected with the application service, the application service loading module, the application service monitoring module and the command line interaction module and is used for providing an interface for a user to remotely control and manage the application service.
2. The operating system application service management system of claim 1, wherein: the command line interaction module manages the corresponding application service through the following command lines:
obtaining the state of the corresponding application service through a command line of 'usd status + corresponding application service';
starting the corresponding application service through a command line of 'usd start + corresponding application service';
closing the corresponding application service through a command line of 'usd stop + corresponding application service';
reloading the configuration file of the corresponding application service through a command line of 'usd load + corresponding application service';
and restarting the corresponding application service through a command line of 'usd restart + corresponding application service'.
3. The operating system application service management system of claim 1, wherein: the application service loading module analyzes the contents of all files in a data structure one by reading/etc/userpace/userpace.d/catalog and starts application service in a fork/exec mode;
the application service monitoring module polls, inquires and monitors the process state of the application service under proc/pid by recording the pid for starting the application service process, thereby determining whether the application service is normally operated;
and under the condition that the application service is abnormally operated, whether the application service is restarted or not is determined by reading the configuration file read by the application service loading module.
4. The operating system application service management system of claim 1, wherein: and the application service monitoring module redirects the output of the stdout and stderr to a log file to realize the recording of the log corresponding to the application service.
5. The operating system application service management system of claim 1, wherein: the operating system application service management system is installed and operated between the system service and the application service through an apt command.
6. Application service management method of an operating system application service management system according to any of claims 1 to 5, characterized in that it comprises the following steps:
step S1: writing usd-based configuration files for application services;
step S2: reloading the configuration file of the application service by using a usd reload command line;
step S3: starting application service in a fork/exec mode; recording pid information and corresponding structural body data, and monitoring the running state of the application service by inquiring and monitoring the process state under proc/pid;
step S4: outputting and redirecting to a log file through stdout and stderr so as to record a corresponding log of the application service;
step S5: when the application service is abnormal, whether the application service is restarted or quitted is judged according to the information of the application service configuration file, and the related information of the abnormal operation of the application service is notified to the user.
7. The application service management method of claim 6, wherein in the step S1, the configuration file of the application service is written in a key value pair-yaml file manner.
8. The application service management method of claim 6, wherein in the step S2, the configuration file of the application service is loaded in/etc/userspad/userspad.d/directory.
9. The application service management method of claim 6, wherein in the step S3, the application service is started by any one of a sub-process, a direct run, a single run, or an idle run.
CN202210780837.7A 2022-07-05 2022-07-05 Operating system application service management system and application service management method thereof Active CN114860326B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210780837.7A CN114860326B (en) 2022-07-05 2022-07-05 Operating system application service management system and application service management method thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210780837.7A CN114860326B (en) 2022-07-05 2022-07-05 Operating system application service management system and application service management method thereof

Publications (2)

Publication Number Publication Date
CN114860326A true CN114860326A (en) 2022-08-05
CN114860326B CN114860326B (en) 2022-10-21

Family

ID=82626676

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210780837.7A Active CN114860326B (en) 2022-07-05 2022-07-05 Operating system application service management system and application service management method thereof

Country Status (1)

Country Link
CN (1) CN114860326B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106201745A (en) * 2016-07-08 2016-12-07 深圳中兴网信科技有限公司 The remote debugging method of application program, remote debugging system and terminal
CN106878467A (en) * 2017-04-07 2017-06-20 同方威视技术股份有限公司 The method and tele-control system of remote control equipment
CN113672456A (en) * 2021-08-06 2021-11-19 济南浪潮数据技术有限公司 Modular self-monitoring method, system, terminal and storage medium of application platform

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106201745A (en) * 2016-07-08 2016-12-07 深圳中兴网信科技有限公司 The remote debugging method of application program, remote debugging system and terminal
CN106878467A (en) * 2017-04-07 2017-06-20 同方威视技术股份有限公司 The method and tele-control system of remote control equipment
CN113672456A (en) * 2021-08-06 2021-11-19 济南浪潮数据技术有限公司 Modular self-monitoring method, system, terminal and storage medium of application platform

Also Published As

Publication number Publication date
CN114860326B (en) 2022-10-21

Similar Documents

Publication Publication Date Title
US6397381B1 (en) System and method for repairing a damaged application program
US6353928B1 (en) First run installer
US6550021B1 (en) Internet-implemented method supporting component repair services
US6721946B1 (en) Method and system for installing software on a computer
US6618857B1 (en) Method and system for installing software on a computer system
US8151277B2 (en) Method and system for dynamic remote injection of in-process agents into virtual machine based applications
KR101343148B1 (en) Automated device driver management
US6698018B1 (en) System and method of multiple-stage installation of a suite of applications
US7185335B2 (en) Programmatic application installation diagnosis and cleaning
US20100325624A1 (en) Method and System for Application Portability
US8560649B2 (en) Virtual appliance automation tool
US7778968B2 (en) Systems and methods for compiling applications on a test server
US7146531B2 (en) Repairing applications
US20020152277A1 (en) System and method for agent reporting in to server
US10599542B2 (en) Device configuration with cached pre-assembled driver state
CN111258561A (en) Method for starting and monitoring software automatic compiling and deploying
US20120005520A1 (en) Simplifying automated software maintenance of data centers
US6519637B1 (en) Method and apparatus for managing a memory shortage situation in a data processing system
US20230259358A1 (en) Documentation enforcement during compilation
CN112214227A (en) Edge server mirror image customization and deployment system and method
CN111930466A (en) Kubernetes-based data synchronization environment deployment method and device
CN114860326B (en) Operating system application service management system and application service management method thereof
Cisco Installing the EISA PC Adapter NetWare Driver
Cisco Installing the EISA PC Adapter NetWare Driver
Cisco Installing the EISA PC Adapter NetWare Driver

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant