Failed to start LSB: starts php-fpm.

执行启动php服务的时候出现启动失败的错误,提示

Failed to start LSB: starts php-fpm.如下执行所示

[root@aa]# service php-fpm start
Redirecting to /bin/systemctl start  php-fpm.service
Job for php-fpm-56.service failed because the control process exited with error code. See "systemctl status php-fpm-56.service" and "journalctl -xe" for details.
[root@aa]# systemctl status php-fpm-56.service
● php-fpm-56.service - LSB: starts php-fpm
   Loaded: loaded (/etc/rc.d/init.d/php-fpm-56; bad; vendor preset: disabled)
   Active: failed (Result: exit-code) since Wed 2021-08-04 10:16:13 CST; 20s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 22962 ExecStop=/etc/rc.d/init.d/php-fpm-56 stop (code=exited, status=1/FAILURE)
  Process: 24522 ExecStart=/etc/rc.d/init.d/php-fpm-56 start (code=exited, status=1/FAILURE)
   CGroup: /system.slice/php-fpm-56.service
           ├─24524 php-fpm: master process (/www/server/php/56/etc/php-fpm.conf)
           ├─25953 php-fpm: pool www
           ├─25955 php-fpm: pool www
           ├─25958 php-fpm: pool www
           ├─25959 php-fpm: pool www
           ├─25960 php-fpm: pool www
           └─25961 php-fpm: pool www

Aug 04 10:16:03 10-46-141-82 systemd[1]: Starting LSB: starts php-fpm...
Aug 04 10:16:13 10-46-141-82 php-fpm-56[24522]: Starting php-fpm [04-Aug-2021 10:16:13] ERROR: the master process didn't send back its status (via the pipe to the calling process)
Aug 04 10:16:13 10-46-141-82 php-fpm-56[24522]: failed
Aug 04 10:16:13 10-46-141-82 systemd[1]: php-fpm-56.service: control process exited, code=exited status=1
Aug 04 10:16:13 10-46-141-82 systemd[1]: Failed to start LSB: starts php-fpm.
Aug 04 10:16:13 10-46-141-82 systemd[1]: Unit php-fpm-56.service entered failed state.
Aug 04 10:16:13 10-46-141-82 systemd[1]: php-fpm-56.service failed.
[root@aa]# ps -e | grep php-fpm
25953 ?        00:46:27 php-fpm
25955 ?        00:47:06 php-fpm
25958 ?        00:46:14 php-fpm
25959 ?        00:47:05 php-fpm
25960 ?        00:45:41 php-fpm
25961 ?        00:45:47 php-fpm
[root@aa]# kill 25953 25955 25958 25959 25960 25961
[root@aa]# ps -e | grep php-fpm
[root@aa]# systemctl start php-fpm-56.service
[root@aa]# systemctl status php-fpm-56.service
● php-fpm-56.service - LSB: starts php-fpm
   Loaded: loaded (/etc/rc.d/init.d/php-fpm-56; bad; vendor preset: disabled)
   Active: active (running) since Wed 2021-08-04 10:33:32 CST; 8s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 22962 ExecStop=/etc/rc.d/init.d/php-fpm-56 stop (code=exited, status=1/FAILURE)
  Process: 26222 ExecStart=/etc/rc.d/init.d/php-fpm-56 start (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/php-fpm-56.service
           ├─26224 php-fpm: master process (/www/server/php/56/etc/php-fpm.conf)
           ├─26225 php-fpm: pool www
           ├─26226 php-fpm: pool www
           ├─26227 php-fpm: pool www
           ├─26228 php-fpm: pool www
           ├─26229 php-fpm: pool www
           ├─26230 php-fpm: pool www
           ├─26231 php-fpm: pool www
           ├─26232 php-fpm: pool www
           ├─26233 php-fpm: pool www
           ├─26234 php-fpm: pool www
           ├─26235 php-fpm: pool www
           ├─26236 php-fpm: pool www
           ├─26237 php-fpm: pool www
           ├─26238 php-fpm: pool www
           ├─26239 php-fpm: pool www
           ├─26241 php-fpm: pool www
           ├─26243 php-fpm: pool www
           ├─26244 php-fpm: pool www
           └─26249 php-fpm: pool www

Aug 04 10:33:32 10-46-141-82 systemd[1]: Starting LSB: starts php-fpm...
Aug 04 10:33:32 10-46-141-82 php-fpm-56[26222]: Starting php-fpm  done
Aug 04 10:33:32 10-46-141-82 systemd[1]: Started LSB: starts php-fpm.


 究其原因,跟nginx一样都是进程占用,杀死占用的进程就好了。。。。。。。。。。。。。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
根据您的需求,您可以使用以下代码来实现添加和删除 IP 地址行的功能: ```python from flask import Flask, request import yaml app = Flask(__name__) @app.route('/prometheus/add', methods=['POST']) def add_ip(): ip_address = request.json.get('ip') # 获取请求参数中的IP地址 # 生成 gpu.yml 配置文件 gpu_config = { 'targets': [ f'{ip_address}:9400', f'{ip_address}:9400' ] } with open('gpu.yml', 'w') as config_file: yaml.dump(gpu_config, config_file) # 生成 node.yml 配置文件 node_config = { 'targets': [ f'{ip_address}:9100', f'{ip_address}:9100' ] } with open('node.yml', 'w') as config_file: yaml.dump(node_config, config_file) # 生成 container.yml 配置文件 container_config = { 'targets': [ f'{ip_address}:9300', f'{ip_address}:9300' ] } with open('container.yml', 'w') as config_file: yaml.dump(container_config, config_file) return 'IP address added successfully' @app.route('/prometheus/del', methods=['POST']) def delete_ip(): ip_address = request.json.get('ip') # 获取请求参数中的IP地址 # 删除 gpu.yml 中的IP地址行 with open('gpu.yml', 'r') as config_file: gpu_config = yaml.safe_load(config_file) gpu_config['targets'] = [target for target in gpu_config['targets'] if not target.startswith(ip_address)] with open('gpu.yml', 'w') as config_file: yaml.dump(gpu_config, config_file) # 删除 node.yml 中的IP地址行 with open('node.yml', 'r') as config_file: node_config = yaml.safe_load(config_file) node_config['targets'] = [target for target in node_config['targets'] if not target.startswith(ip_address)] with open('node.yml', 'w') as config_file: yaml.dump(node_config, config_file) # 删除 container.yml 中的IP地址行 with open('container.yml', 'r') as config_file: container_config = yaml.safe_load(config_file) container_config['targets'] = [target for target in container_config['targets'] if not target.startswith(ip_address)] with open('container.yml', 'w') as config_file: yaml.dump(container_config, config_file) return 'IP address deleted successfully' if __name__ == '__main__': app.run() ``` 在上述代码中,我们创建了两个接口 `/prometheus/add` 和 `/prometheus/del`,分别用于添加和删除 IP 地址行。根据接口的请求参数中的 IP 地址,我们通过读取和修改 YAML 配置文件来实现相应的操作。 请注意,上述代码仅为示例,您可能需要根据实际需求进行修改和扩展。同时,确保您已安装了相应的依赖库,如 Flask 和 PyYAML。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值