0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

プロセスを停止する方法

Last updated at Posted at 2021-09-29

目的

  • 任意のプロセスを停止する方法をまとめる

ご注意

  • プロセスを停止する際に管理者権限($ sodoコマンドの実行権限)が必要な場合があります。
  • 本番環境などのプロセスを停止すると提供しているサービスに影響が出る可能性があります。
  • しっかりと確認した上でプロセスを停止しましょう。
  • 本記事を参考に作業頂きいかなる問題が発生した場合でも当方は責任を置いかねます。

方法

  1. 下記コマンドを実行して任意のサービスのプロセスを確認する。

    $ ps -le | grep サービス名
    
  2. 下記のように出力される。

    $ ps -le | grep サービス名
    >F S   UID   PID  PPID  C PRI  NI ADDR SZ WCHAN  TTY          TIME CMD
    >1 S     0 XXXXX     1  0  YY   0 - ZZZZZ -      ?        00:01:05 サービス名
    
  3. 上記の出力でXXXXXとなっている部分がPIDといいプロセスナンバーとなっている。

  4. 下記コマンドを実行して当該のプロセスを停止する。

    $ sudo kill XXXXX
    
  5. 下記コマンドを実行して何も出力されないことを確認する。

    $ ps -le | grep プロセス名
    
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?