linux进程自动关闭相关
1.查看进程是否还在:
[root@VM_0_2_centos node_exporter-0.18.1.linux-amd64]# ps -ef |grep node_exporter
root 5368 31761 0 15:00 pts/1 00:00:00 ./node_exporter
root 7410 31761 0 15:11 pts/1 00:00:00 grep --color=auto node_exporter
2.后台不关闭进程方式启动进程
nohup ./node_exporter &
解释:
nohup 保证node_exporter 进程不会被关闭
&表示后台运行
https://blog.csdn.net/ianly123/article/details/85113539
https://www.cnblogs.com/jinxiao-pu/p/9131057.html#_label1
===========================
3.格式化日期显示进程关闭情况
sudo dmesg -T | grep "node_exporter"
[Fri Mar 13 17:16:54 2020] [ 3188] 0 3188 28739 2374 15 0 0 node_exporter
[Fri Mar 13 19:10:27 2020] [ 3188] 0 3188 28739 2610 15 0 0 node_exporter
进一步:sudo dmesg -T | grep "3188 " 查看该进程关闭情况