[步骤] 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 的任务为例)