解决 (code=exited, status=203/EXEC) 问题,关闭 openEuler 的SELinux与防火墙 firewall

缘起

一系列服务直接从 Ubuntu 迁移至 openEuler后, 发现很多Systemd服务启动失败。 报错(code=exited, status=203/EXEC)

通过检查系统日志tail -f /var/log/messages 发现以下关键信息:

  1. systemd 执行xxx程序 权限拒绝。
    systemd[5646]: xxx.service: Failed to locate executable /root/server/xxx/xxx: Permission denied
  2. SELinux 阻止xxx程序访问xxx文件。
    setroubleshoot[5649]: SELinux is preventing (xxx) from execute access on the file xxx. For complete SELinux messages run: sealert -l xxxxx

由于在本地环境相对安全,为了使服务立即上线,这里简单粗暴地直接关闭 SELinuxFirewall

防火墙 Firewall

查看防火墙状态

有两种方式:

  1. 执行命令firewall-cmd --state
    运行中

    running

    未启用

    not running

  2. 执行命令systemctl status firewalld.service

    运行中

    Active: active (running)

    未启用

    Active: inactive (dead)

关闭防火墙

  1. 关闭防火墙服务systemctl stop firewalld.service
  2. 关闭防火墙开机自启 systemctl disable firewalld.service

SELinux

查看SELinux状态

  1. 使用命令SELinux

    启用

    Enforcing

    如果违反安全策略, 不会拒绝操作,仅记录日志。

    Permissive

    未启用

    Disabled

关闭 SELinux

  1. 编辑配置文件 vim /etc/selinux/config, 将SELINUX=enforcing 改为 SELINUX=disabled
  2. 重启生效 shutdown -r now
  • 3
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 2
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Spaceack

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值