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

[内容] Linux 目录的重新挂载

内容一:手动重新挂载目录

# mount -o remount,nosuid,nodev,noexec /dev/shm

(补充:这里以带 nosuid、nodev 和 noexec 参数重新挂载 /dev/shm 目录为例)

内容二:开机自动重新挂载目录

# vim /etc/fstab

添加以下内容:

......
tmpfs /dev/shm tmpfs defaults,nosuid,nodev,noexec 0 0

(补充:这里以带 nosuid、nodev 和 noexec 参数重新挂载 /dev/shm 目录为例)

[内容] Linux 虚拟机和物理机的区分

如果是虚拟机:

# dmidecode -s system-product-name
VMware7,1

(补充:从输出结果可以看出此为 VMware7,1 虚拟机)

或者:

# systemd-detect-virt
vmware

(补充:从输出结果可以看出此为 vmware 虚拟机)

如果是物理机:

# dmidecode -s system-product-name
PowerEdge R940

(补充:从输出结果可以看出此为 PowerEdge R940 物理机)

或者:

# systemd-detect-virt 
none

(补充:从输出结果可以看出此为物理机)