stbyruby 发表于 2019-2-16 11:20:45

centos7给进程分配pid文件


[*]让进程后台运行:
somecode&
[*]创建pid文件:
echo$!>/path/to/test.pid
[*]示例代码:
#!/bin/bash
while true ; do
echo "hello" > /etc/null
sleep 1
done &
echo $! > /run/lib/test.pid



页: [1]
查看完整版本: centos7给进程分配pid文件