Distributions
› Ubuntu
› Fedora
› CentOS
中文资源站
› 网易开源镜像站
Vegetable
V2EX  ›  Linux

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

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