Преглед изворни кода

优化修改远程运维模块sshd的说明

niujiuru пре 3 недеља
родитељ
комит
003ea2d178
1 измењених фајлова са 32 додато и 8 уклоњено
  1. 32 8
      sshd/readme.txt

+ 32 - 8
sshd/readme.txt

@@ -20,7 +20,30 @@
 - 客户端启动时,会连接到MQTT Broker,订阅主题:/yfkj/device/rpc/imei/ack,接收服务端的指令结果
 
 6,总体架构图:
+┌────────────────────────────┐
+│        Shell Client        │
+│                            │
+│  stdin ──> JSON-RPC call   │
+│  Ctrl+C ─> JSON-RPC notify │
+│                            │
+│  prompt 显示 cwd           │
+└──────────────┬─────────────┘
+               │
+    JSON-RPC 2.0 over MQTT
+               │
+┌──────────────▼─────────────┐
+│        Shell Server        │
+│                            │
+│  Executor (session级)      │
+│   ├─ cwd                   │
+│   ├─ Exec(cmd)             │
+│   ├─ Interrupt()           │
+│                            │
+│  process group (pgid)      │
+│   └─ kill(-pgid, SIGINT)   │
+└────────────────────────────┘
 
+6,执行流程图:
 ┌──────────────────────────────────────────┐
 │              Remote Client               │
 │        (Web / App / CLI 运维平台)        │
@@ -88,7 +111,8 @@
 │  - SIGTERM → SIGKILL                     │
 │                                          │
 └───────────────┬──────────────────────────┘
-                │
+                │ MQTT Message
+                | Topic: /yfkj/device/rpc/{imei}/ack
                 v
 ┌──────────────────────────────────────────┐
 │               Linux Kernel               │
@@ -98,12 +122,12 @@
 │  - Exit Status                           │
 └──────────────────────────────────────────┘
 
-7, 取消设计图:Ctrl+C
+8, 取消流程图:Ctrl+C
 
 Remote Client
-   │
-   │ shell.execute
-   v
+    
+       │ shell.execute
+       v
 ┌───────────────┐
 │ sshd          │
 └──────┬────────┘
@@ -133,9 +157,9 @@ Remote Client
    Command Running                  │
 Remote Client Ctrl+C                │
-   
-   │ shell.interrupt    
-   v
+       
+       │ shell.interrupt            │
+       v
 ┌───────────────┐                   │
 │ sshd          │                   │
 └──────┬────────┘                   │