V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
Distributions
Ubuntu
Fedora
CentOS
中文资源站
网易开源镜像站
Vegetable
V2EX  ›  Linux

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

  •  
  •   Vegetable · Jun 13, 2019 · 6288 views
    This topic created in 2512 days ago, the information mentioned may be changed or developed.

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

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

    14 replies    2019-06-13 17:54:21 +08:00
    skylancer
        1
    skylancer  
       Jun 13, 2019
    在没开审计的情况下好像没办法
    yidinghe
        2
    yidinghe  
       Jun 13, 2019   ❤️ 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  
       Jun 13, 2019
    等一个大佬
    坐等涨姿势
    jiangxinlingdu
        4
    jiangxinlingdu  
       Jun 13, 2019
    围观……
    sparkssssssss
        5
    sparkssssssss  
       Jun 13, 2019
    围观下.
    winterfell30
        6
    winterfell30  
       Jun 13, 2019
    围观
    harde
        7
    harde  
       Jun 13, 2019
    reboot
    Cooky
        8
    Cooky  
       Jun 13, 2019 via Android
    先看看 mongodb 报啥错呗
    263
        9
    263  
       Jun 13, 2019
    这个多半就是 kill 掉了 mongodb 的进程,然后 pid 文件还存在,启动的时候 pid 文件冲突,导致无法启动。
    dfourc
        10
    dfourc  
       Jun 13, 2019
    坐下
    jsnjfz
        11
    jsnjfz  
       Jun 13, 2019
    history 看看操作历史?
    xiulu
        12
    xiulu  
       Jun 13, 2019   ❤️ 1
    @yidinghe 普通用户 kill 掉的进程,如果没做特殊的配置,是不会被系统记录的 https://unix.stackexchange.com/questions/168797/logging-of-what-ended-a-process
    zycpp
        13
    zycpp  
       Jun 13, 2019 via iPhone
    老哥稳嗷~真就敢随便 kill 进程嗷~
    Vegetable
        14
    Vegetable  
    OP
       Jun 13, 2019
    @Cooky 看完了..mongodb 是因为配置文件当年启动是指定配置文件启动的,太久了忘记了指定配置文件了,指定了一下就启动了,但是我还是不知道我杀了谁,可能就是 mongodb
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   984 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 53ms · UTC 21:55 · PVG 05:55 · LAX 14:55 · JFK 17:55
    ♥ Do have faith in what you're doing.