我无法理解下面的 shell 脚本。具体来说,什么是Kill -0
(零)
while kill -0 ${docker_pid} 2>/dev/null
do
#do something here
done
我发现的所有终止信号文档都从 1...31 开始记录
#ifndef _POSIX_SOURCE
#include <machine/trap.h> /* codes for SIGILL, SIGFPE */
#endif /* _POSIX_SOURCE */
#define SIGHUP 1 /* hangup */
#define SIGINT 2 /* interrupt */
#define SIGQUIT 3 /* quit */
#define SIGILL 4 /* illegal instruction (not reset when caught) */
#ifndef _POSIX_SOURCE
#define SIGTRAP 5 /* trace trap (not reset when caught) */
#endif
... signal.h continues ....
kill -0 <pid>
如果进程存在,则只给出返回值 0,如果不存在则返回 1。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句