Compartilhamento de tecnologia

Como lidar com a falha ao desligar um serviço no Linux

2024-07-12

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

No servidor Linux, quando estou prestes a fechar o aplicativo Java, recebo o seguinte erro:

  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

Se não quiser reiniciar o host, você pode tentar os seguintes métodos para resolver este problema:

1. Verifique o status do processo ps aux |

  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. Processe manualmente o processo 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]

A julgar pelos resultados acima, está tudo bem