[内容] SUSE Repository Mirroring Tool (RMT) 服务端的设置 (软件源)

内容一:显示软件源

1.1 显示所有的 SUSE 软件源产品

# rmt-cli products list --all

1.2 显示所有已经启用的 SUSE 软件源产品

# rmt-cli products list

1.3 显示所有指定版本且指定架构的 SUSE 软件源产品

# rmt-cli products list --all --version=15.4 --arch=x86_64

(补充:这里以显示所有 15.4 版本且 x86_64 架构的 SUSE 软件源产品为例)

1.4 显示所有已启用指定版本且指定架构的 SUSE 软件源产品

# rmt-cli products list --version=15.4 --arch=x86_64

(补充:这里以显示所有已其应用 15.4 版本且 x86_64 架构的 SUSE 软件源产品为例)

内容二:启用软件源

2.1 启用某个软件源

# rmt-cli products enable <id>

或者:

# rmt-cli products enable <string>

2.2 开启所有指定版本且指定架构的 SUSE 软件源产品

# for i in `rmt-cli products list --all --version=15.4 --arch=x86_64 | awk '{print $2}' | egrep -v '\||ID|^$'`;do rmt-cli products enable $i;done

(补充:这里以开启所有 15.4 版本且 x86_64 架构的 SUSE 软件源产品)

内容三:取消启用软件源

3.1 取消启用某个软件源

# rmt-cli products disable <id>

或者:

# rmt-cli products disable <string>

3.2 取消所有指定版本且指定架构的 SUSE 软件源产品

# for i in `rmt-cli products list --all --version=15.4 --arch=x86_64 | awk '{print $2}' | egrep -v '\||ID|^$'`;do rmt-cli products disable $i;done

(补充:这里以取消开启所有 15.4 版本且 x86_64 架构的 SUSE 软件源产品)

参考文献:

https://documentation.suse.com/sles/15-SP4/single-html/SLES-rmt/index.html#sec-rmt-tools-rmt-cli

[步骤] Red Hat Satellite 无法停止任务的强制停止

步骤一:打一个快照

(步骤略)

步骤二:显示运行结果是错误的任务

# sudo su - postgres -c "psql -d foreman -c 'select label,count(label),state,result from foreman_tasks_tasks where state <> '\''stopped'\'' group by label,state,result ORDER BY label;'"
                        label                         | count |   state   | result  
------------------------------------------------------+-------+-----------+---------
 Actions::Katello::ContentView::Publish               |     1 | paused    | error
 ......

(补充:从这里可以看出运行结果是错误的任务标签是 Actions::Katello::ContentView::Publish)

步骤三:强制停止 Red Hat Satellite 无法停止的任务

# foreman-rake foreman_tasks:cleanup TASK_SEARCH='label = Actions::Katello::ContentView::Publish' STATES='paused' VERBOSE=true

(补充:这里以强制停止标签为 Actions::Katello::ContentView::Publish 的任务为例)

[步骤] Red Hat Satellite Content View 信息的显示

步骤一:显示所有 Content View 的 ID

# hammer content-view list

----------------|---------------------------|--------------------------------------|-----------|---------------------|---------------------------------------------------------------------------------
CONTENT VIEW ID | NAME                      | LABEL                                | COMPOSITE | LAST PUBLISHED      | REPOSITORY IDS                                                                  
----------------|---------------------------|--------------------------------------|-----------|---------------------|---------------------------------------------------------------------------------
10              | test_CV                   | test_CV                              | false     | 2022/06/23 20:20:20 | 61525, 16812, 61524, 16814, 16813, 16811, 16816, 16817, 6578, 231, 8, 9, 131,...

步骤二:显示某 1 个 Content View 的详细信息

# hammer content-view info --id 10

(补充:这里以显示 ID 为 10 的 Content View 的信息为例)