

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 管理代理程式
<a name="managing-agent"></a>

 AWS Ground Station 代理程式提供下列功能，可讓您使用內建 Linux 命令工具來設定、啟動、停止、升級、降級和解除安裝代理程式。

**主題**
+ [AWS Ground Station 代理程式組態](#gs-agent-configuration)
+ [AWS Ground Station 代理程式啟動](#gs-agent-start)
+ [AWS Ground Station 代理程式停止](#gs-agent-stop)
+ [AWS Ground Station 客服人員升級](#gs-agent-upgrade)
+ [AWS Ground Station 客服人員降級](#gs-agent-downgrade)
+ [AWS Ground Station 代理程式解除安裝](#gs-agent-uninstall)
+ [AWS Ground Station 客服人員狀態](#gs-agent-status)
+ [AWS Ground Station 客服人員 RPM 資訊](#gs-agent-rpm-info)

## AWS Ground Station 代理程式組態
<a name="gs-agent-configuration"></a>

 導覽至 `/opt/aws/groundstation/etc`，其中應包含名為 aws-gs-agent-config.json 的單一檔案。請參閱 [代理程式組態檔案](configuring-agent.md#agent-config-file) 

## AWS Ground Station 代理程式啟動
<a name="gs-agent-start"></a>

```
#start
sudo systemctl start aws-groundstation-agent

#check status
systemctl status aws-groundstation-agent
```

應該產生顯示代理**程式作用中**的輸出。

```
aws-groundstation-agent.service - aws-groundstation-agent
Loaded: loaded (/usr/lib/systemd/system/aws-groundstation-agent.service; enabled; vendor preset: disabled)
Active: active (running) since Tue 2023-03-14 00:39:08 UTC; 1 day 13h ago
Docs: https://aws.amazon.com/ground-station/
Main PID: 8811 (aws-gs-agent)
CGroup: /system.slice/aws-groundstation-agent.service
└─8811 /opt/aws/groundstation/bin/aws-gs-agent production
```

## AWS Ground Station 代理程式停止
<a name="gs-agent-stop"></a>

```
#stop
sudo systemctl stop aws-groundstation-agent

#check status
systemctl status aws-groundstation-agent
```

 應該產生顯示代理程式處於**非作用中** （已停止） 的輸出。

```
aws-groundstation-agent.service - aws-groundstation-agent
Loaded: loaded (/usr/lib/systemd/system/aws-groundstation-agent.service; enabled; vendor preset: disabled)
Active: inactive (dead) since Thu 2023-03-09 15:35:08 UTC; 6min ago
Docs: https://aws.amazon.com/ground-station/
Process: 84182 ExecStart=/opt/aws/groundstation/bin/launch-aws-gs-agent (code=exited, status=0/SUCCESS)
Main PID: 84182 (code=exited, status=0/SUCCESS)
```

## AWS Ground Station 客服人員升級
<a name="gs-agent-upgrade"></a>

1. 下載最新版本的代理程式。請參閱 [下載代理程式](installing-the-agent.md#download-agent)。

1. 停止 代理程式。

   ```
   #stop
   sudo systemctl stop aws-groundstation-agent
   
   #confirm inactive (stopped) state
   systemctl status aws-groundstation-agent
   ```

1. 更新代理程式。

   ```
   sudo yum update ${MY_RPM_FILE_PATH}
   
   # check the new version has been installed correctly by comparing the agent version with the starting agent version
   yum info aws-groundstation-agent
   
   # reload the systemd configuration
   sudo systemctl daemon-reload
   
   # restart the agent
   sudo systemctl restart aws-groundstation-agent
   
   # check agent status
   systemctl status aws-groundstation-agent
   ```

## AWS Ground Station 客服人員降級
<a name="gs-agent-downgrade"></a>

1. 下載您需要的代理程式版本。請參閱 [下載代理程式](installing-the-agent.md#download-agent)。

1. 降級代理程式。

   ```
   # get the starting agent version
   yum info aws-groundstation-agent
   
   # stop the agent service
   sudo systemctl stop aws-groundstation-agent
   
   # downgrade the rpm
   sudo yum downgrade ${MY_RPM_FILE_PATH}
   
   # check the new version has been installed correctly by comparing the agent version with the starting agent version
   yum info aws-groundstation-agent
   
   # reload the systemd configuration
   sudo systemctl daemon-reload
   
   # restart the agent
   sudo systemctl restart aws-groundstation-agent
   
   # check agent status
   systemctl status aws-groundstation-agent
   ```

## AWS Ground Station 代理程式解除安裝
<a name="gs-agent-uninstall"></a>

 解除安裝代理程式會將 /opt/aws/groundstation/etc/aws-gs-agent-config.json 重新命名為 /opt/aws/groundstation/etc/aws-gs-agent-config.json.rpmsave。再次在同一執行個體上安裝代理程式會寫入 aws-gs-agent-config.json 的預設值，而且需要更新為對應於您 AWS 資源的正確值。請參閱 [代理程式組態檔案](configuring-agent.md#agent-config-file)。

```
sudo yum remove aws-groundstation-agent
```

## AWS Ground Station 客服人員狀態
<a name="gs-agent-status"></a>

 客服人員狀態為**作用中** （客服人員正在執行） 或非**作用中** （客服人員已停止）。

```
systemctl status aws-groundstation-agent
```

 輸出範例顯示代理程式已安裝、非**作用中**狀態 （已停止） 和**已啟用** （開機時啟動服務）。

```
aws-groundstation-agent.service - aws-groundstation-agent
Loaded: loaded (/usr/lib/systemd/system/aws-groundstation-agent.service; enabled; vendor preset: disabled)
Active: inactive (dead) since Thu 2023-03-09 15:35:08 UTC; 6min ago
Docs: https://aws.amazon.com/ground-station/
Process: 84182 ExecStart=/opt/aws/groundstation/bin/launch-aws-gs-agent (code=exited, status=0/SUCCESS)
Main PID: 84182 (code=exited, status=0/SUCCESS)
```

## AWS Ground Station 客服人員 RPM 資訊
<a name="gs-agent-rpm-info"></a>

```
yum info aws-groundstation-agent
```

 其輸出如下：

**注意**  
「版本」可能會根據最新的代理程式發佈版本而有所不同。

```
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
Installed Packages
Name        : aws-groundstation-agent
Arch        : x86_64
Version     : 1.0.2677.0
Release     : 1
Size        : 51 M
Repo        : installed
Summary     : Client software for AWS Ground Station
URL         : https://aws.amazon.com/ground-station/
License     : Proprietary
Description : This package provides client applications for use with AWS Ground Station
```