Long-Term Supported Versions

    Innovation Versions

      sysmaster Usage Instructions

      This section provides examples on how to use sysmaster, including:

      • service unit configuration file creation
      • unit service management operations, such as starting, stopping, and viewing services

      For more, see the sysMaster official manual.

      Unit Configuration File Creation

      You can create unit configuration files in the /usr/lib/sysmaster/system/ directory.

      Types of Unit Configuration Files

      Currently, sysmaster supports unit configuration files of the target, socket, and service types.

      • target: Encapsulated startup target managed by sysmaster, which is used for grouping units as a synchronization point. sysmaster provides targets for different states. For example, multi-user.target indicates that the system has been started. You can use this target to configure services to run in this state.
      • socket: Encapsulated socket for inter-process communication to support socket-based startup. For example, you can configure a service unit to depend on a socket. When data is written to the socket, sysmaster starts the corresponding service unit.
      • service: Encapsulated process monitored and controlled by sysmaster.

      Composition of Unit Configuration Files

      A unit configuration file consists of three sections:

      • Unit: common configuration description of the unit, such as the service name, description, and dependencies
      • Install: description of how the service is installed and started
      • Service and Socket: configurations of different unit types

      Creating a service Unit

      The sshd service is used to remotely log in to the server and run commands and perform operations on the remote terminal. The following configuration items are used to create an sshd.service service unit:

      [Unit]
      Description="OpenSSH server daemon"
      Documentation="man:sshd(8) man:sshd_config(5)"
      After="sshd-keygen.target"
      Wants="sshd-keygen.target"
      
      [Service]
      Type="notify"
      EnvironmentFile="-/etc/sysconfig/sshd"
      ExecStart="/usr/sbin/sshd -D $OPTIONS"
      ExecReload="/bin/kill -HUP $MAINPID"
      KillMode="process"
      Restart="on-failure"
      RestartSec=42
      
      [Install]
      WantedBy="multi-user.target"
      

      The configuration items in the example are described as follows:

      • Description: Main functions of the unit.
      • Documentation: Document link of the unit.
      • After: Unit startup sequence. In the example, sshd.service is started after sshd-keygen.target.
      • Wants: Dependency on another unit. In the example, sshd-keygen.target is automatically started with sshd.service.
      • Type: How sysmaster starts the service. notify indicates that a notification will be sent after the main process is started.
      • EnvironmentFile: Path of file that stores environment variables to be loaded.
      • ExecStart: Command executed when the service is started. In the example, sshd is executed when sshd.service is started.
      • ExecReload: Command executed to reload the sshd.service configurations.
      • KillMode: How the process is killed when the service process needs to be stopped. process indicates that only the main process is killed.
      • Restart: Whether to restart the service when the service exits or stops in different situations. on-failure indicates that the service is restarted when the service exits abnormally.
      • RestartSec: Amount of time to wait before the service is restarted after the service exits.
      • WantedBy: Units that depend on sshd.service.

      Unit Service Management

      sctl is a CLI tool of sysmaster. It is used to check and control the behavior of the sysmaster server and the status of each service. It can start, stop, restart, and check system services.

      Starting a Service

      Run the following command to start the sshd service and run the commands specified by ExecStart:

      # sctl start sshd.service
      

      Stopping a Service

      Run the following command to stop the sshd service and kill the process started by ExecStart:

      # sctl stop sshd.service
      

      Restarting a Service

      Run the following command to restart the sshd service. After the command is executed, the sshd service is stopped and then started.

      # sctl restart sshd.service
      

      Checking Service Status

      Run the following command to check the status of the sshd service. You can check whether the service is running properly by viewing the service status.

      # sctl status sshd.service
      

      Bug Catching

      Buggy Content

      Bug Description

      Submit As Issue

      It's a little complicated....

      I'd like to ask someone.

      PR

      Just a small problem.

      I can fix it online!

      Bug Type
      Specifications and Common Mistakes

      ● Misspellings or punctuation mistakes;

      ● Incorrect links, empty cells, or wrong formats;

      ● Chinese characters in English context;

      ● Minor inconsistencies between the UI and descriptions;

      ● Low writing fluency that does not affect understanding;

      ● Incorrect version numbers, including software package names and version numbers on the UI.

      Usability

      ● Incorrect or missing key steps;

      ● Missing prerequisites or precautions;

      ● Ambiguous figures, tables, or texts;

      ● Unclear logic, such as missing classifications, items, and steps.

      Correctness

      ● Technical principles, function descriptions, or specifications inconsistent with those of the software;

      ● Incorrect schematic or architecture diagrams;

      ● Incorrect commands or command parameters;

      ● Incorrect code;

      ● Commands inconsistent with the functions;

      ● Wrong screenshots.

      Risk Warnings

      ● Lack of risk warnings for operations that may damage the system or important data.

      Content Compliance

      ● Contents that may violate applicable laws and regulations or geo-cultural context-sensitive words and expressions;

      ● Copyright infringement.

      How satisfied are you with this document

      Not satisfied at all
      Very satisfied
      Submit
      Click to create an issue. An issue template will be automatically generated based on your feedback.
      Bug Catching
      编组 3备份