技術共有

Linux でサービスのシャットダウンに失敗した場合の対処方法

2024-07-12

한어Русский языкEnglishFrançaisIndonesianSanskrit日本語DeutschPortuguêsΕλληνικάespañolItalianoSuomalainenLatina

Linux サーバーで Java アプリケーションを閉じようとすると、次のエラーが表示されます。

  1. [root@VM-32-25-centos ~]# service eposGatewayService stop
  2. Application is running as root (UID 0). This is considered insecure.
  3. Unable to kill process 7080

ホストを再起動したくない場合は、次の方法を試してこの問題を解決できます。

1. プロセスのステータスを確認します ps aux | eposGatewayService

  1. [root@VM-32-25-centos ~]# ps aux | grep eposGatewayService
  2. root 28217 0.0 0.0 112812 964 pts/0 S+ 15:09 0:00 grep --color=auto eposGatewayService

2. プロセスを手動で処理します sudo kill -9 7080

  1. [root@VM-32-25-centos ~]# sudo kill -9 7080
  2. [root@VM-32-25-centos ~]# service eposGatewayService stop
  3. Application is running as root (UID 0). This is considered insecure.
  4. Not running (process 7080). Removing stale pid file.
  5. [root@VM-32-25-centos ~]# service eposGatewayService start
  6. Application is running as root (UID 0). This is considered insecure.
  7. Started [28643]

上記の実行結果から判断すると、問題ありません