Centos7 Bash: Fuser: Command Not Found 解决办法


title: centos7 bash: fuser: command not found 解决办法
category: linux
tag :centos7

  • centOs7 bash: fuser: command not found 解决办法
    • 提示没有fuser 需要安装psmisc
      1
      2
      3
      4
      5
      6
      7
      8
      9
      Psmisc软件包包含三个帮助管理/proc目录的程序。
      安装下列程序: fuser, killall,pstree和pstree.x11(到pstree的链接)
      简短说明
      fuser 显示使用指定文件或者文件系统的进程的PID。
      killall 杀死某个名字的进程,它向运行指定命令的所有进程发出信号。
      pstree 树型显示当前运行的进程。
      pstree.x11 与pstree功能相同,只是在退出前需要确认。
      Psmisc 安装依赖关系
      Psmisc 依赖于: Bash, Binutils, Coreutils, Diffutils, GCC, Gettext, Glibc, Grep, Make, Ncurses, Sed.
  • 安装psmisc
    1
    yum install psmisc

centos7 防火墙无法加入nginx权限问题

  • 将nginx服务加入防火墙白名单
    1
    firewall-cmd --zone=public --add-port=80/tcp --permanent
  • 错误提示Error: INVALID_SERVICE: 'nginx' not among existing services
  • vi /etc/firewalld/services/nginx.xml
    1
    2
    3
    4
    5
    6
    <?xml version="1.0" encoding="utf-8"?>
    <service>
    <short>Nginx</short>
    <description>nginx</description>
    <port protocol="tcp" port="80"/>
    </service>
  • 重新加载防火墙配置
    1
    firewall-cmd --reload
  • 再次加入
    1
    firewall-cmd --zone=public --add-port=80/tcp --permanent
  • 重新加载配置解决
    1
    firewall-cmd --reload
  • 防火墙常用命令
    1
    2
    3
    4
    5
    systemctl start firewalld.service #开启firewall
    systemctl stop firewalld.service #停止firewall
    systemctl disable firewalld.service #禁止firewall开机启动
    firewall-cmd --state #查看默认防火墙状态(关闭后显示notrunning,开启后显示running)
    systemctl restart firewalld.service #重启firewall

安装nginx

1
2
3
yum install nginx
service nginx start
chkconfig --levels 235 nginx on