V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Distributions
Ubuntu
Fedora
CentOS
中文资源站
网易开源镜像站
Vegetable
V2EX  ›  Linux

嗯...不小心 kill 错了进程,怎么能查到那个进程本来是什么?

  •  
  •   Vegetable · 2019-06-13 10:50:43 +08:00 · 5565 次点击
    这是一个创建于 1750 天前的主题,其中的信息可能已经有所发展或是发生改变。

    今天一抽把 netstat -plnt|grep 8081 和 kill pid 变成了一个 kill 8081,没有出现万事大吉的 no such process ,然后 mongodb 挂掉无法启动了...

    我怎么才能知道我杀了谁?

    14 条回复    2019-06-13 17:54:21 +08:00
    skylancer
        1
    skylancer  
       2019-06-13 11:23:21 +08:00
    在没开审计的情况下好像没办法
    yidinghe
        2
    yidinghe  
       2019-06-13 11:34:18 +08:00   ❤️ 2
    https://stackoverflow.com/questions/726690/what-killed-my-process-and-why

    Try:

    dmesg -T| grep -E -i -B100 'killed process'

    Where -B100 signifies the number of lines before the kill happened.

    Omit -T on Mac OS.
    wwg1994
        3
    wwg1994  
       2019-06-13 13:18:52 +08:00
    等一个大佬
    坐等涨姿势
    jiangxinlingdu
        4
    jiangxinlingdu  
       2019-06-13 13:27:26 +08:00
    围观……
    coolloves
        5
    coolloves  
       2019-06-13 13:29:11 +08:00
    围观下.
    winterfell30
        6
    winterfell30  
       2019-06-13 13:30:22 +08:00
    围观
    harde
        7
    harde  
       2019-06-13 13:37:41 +08:00
    reboot
    Cooky
        8
    Cooky  
       2019-06-13 13:40:06 +08:00 via Android
    先看看 mongodb 报啥错呗
    263
        9
    263  
       2019-06-13 13:47:46 +08:00
    这个多半就是 kill 掉了 mongodb 的进程,然后 pid 文件还存在,启动的时候 pid 文件冲突,导致无法启动。
    galikeoy
        10
    galikeoy  
       2019-06-13 16:57:36 +08:00
    坐下
    jsnjfz
        11
    jsnjfz  
       2019-06-13 17:01:55 +08:00
    history 看看操作历史?
    xiulu
        12
    xiulu  
       2019-06-13 17:10:20 +08:00   ❤️ 1
    @yidinghe 普通用户 kill 掉的进程,如果没做特殊的配置,是不会被系统记录的 https://unix.stackexchange.com/questions/168797/logging-of-what-ended-a-process
    zycpp
        13
    zycpp  
       2019-06-13 17:32:25 +08:00 via iPhone
    老哥稳嗷~真就敢随便 kill 进程嗷~
    Vegetable
        14
    Vegetable  
    OP
       2019-06-13 17:54:21 +08:00
    @Cooky 看完了..mongodb 是因为配置文件当年启动是指定配置文件启动的,太久了忘记了指定配置文件了,指定了一下就启动了,但是我还是不知道我杀了谁,可能就是 mongodb
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3001 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 14:58 · PVG 22:58 · LAX 07:58 · JFK 10:58
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.