【发布时间】:2018-09-12 08:38:19
【问题描述】:
我有一组 supervisord 运行进程,我想使用脚本自动启动和停止。 但有时主管关闭命令需要很长时间才能完成,并且等待时间开始堆积。 目前我正在做:
for each in "${args[@]}"; do
(supervisorctl -c configs/supervisord_${each}.conf shutdown) & sleep 8s & (kill -9 `ps aux | grep supervisor| grep ${each} | a wk '{print $2}'` && kill -9 `ps aux | grep supervisor| grep ${each} | awk '{print $2}'`)
done
如果停止时间过长,是否有更清洁的方法可以在几秒钟后杀死主管进程?
需要明确的是,我正在尝试使用 supervisorctl -c {config path} shutdown 而不是 supervisorctl shutdown 命令本身来终止我试图关闭的主管进程。
【问题讨论】:
标签: linux bash centos rhel supervisord