我正在创建一个脚本,它可以从git存储库中提取一些内容。
但是首先我想要发送一个SIGUSR1到我在机器上运行的多个节点,一旦所有进程停止,我将继续执行git拉
所以基本上我会运行
killall -s SIGUSR1 node
因为我的节点正在做一个无限循环,所以我想截获这个信号,并在我知道它不会影响任何数据的循环的一部分中终止。
因此,当所有节点都停止时,我将继续
但是,在执行git提取并再次启动节点循环之前,如何等待所有节点进程完全退出呢?
发布于 2017-12-26 15:34:42
来自man killall
-w, --wait
Wait for all killed processes to die. killall checks once per second if any of the
killed processes still exist and only returns if none are left. Note that killall may
wait forever if the signal was ignored, had no effect, or if the process stays in zombie
state.
https://stackoverflow.com/questions/47980136
复制相似问题