/usr/bin/mysqld_safe_helper: Cannot change uid/gid (errno: 1) (转)
From: https://www.rootusers.com/how-to-fix-mariadb-10-0-29-selinux-update-failure/
安装mysql 10.0.29后,启动mysql失败:
[root@server centos]# systemctl status mysql
â mysql.service - LSB: start and stop MySQL
Loaded: loaded (/etc/rc.d/init.d/mysql; bad; vendor preset: disabled)
Active: failed (Result: exit-code) since Sat -- :: UTC; 4s ago
Docs: man:systemd-sysv-generator()
Process: ExecStop=/etc/rc.d/init.d/mysql stop (code=exited, status=/SUCCESS)
Process: ExecStart=/etc/rc.d/init.d/mysql start (code=exited, status=/FAILURE) Jan :: server systemd[]: Starting LSB: start and stop MySQL...
Jan :: server mysql[]: Starting MySQL. :: mysqld_safe Logging to '/var/lib/mysql/server.err'.
Jan :: server mysql[]: :: mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
Jan :: server mysql[]: /usr/bin/mysqld_safe_helper: Cannot change uid/gid (errno: )
Jan :: server mysql[]: ERROR!
Jan :: server systemd[]: mysql.service: control process exited, code=exited status=
Jan :: server systemd[]: Failed to start LSB: start and stop MySQL.
Jan :: server systemd[]: Unit mysql.service entered failed state.
Jan :: server systemd[]: mysql.service failed.
可以看到,myql服务状态是down。错误显示mysqld_safe_helper 试图更改UID/GID:
Jan :: server mysql[]: /usr/bin/mysqld_safe_helper: Cannot change uid/gid (errno: )
根据错误提示,执行 journalctl -xe命令:
[root@server mysql]# journalctl -xe
Jan :: server setroubleshoot[]: SELinux is preventing /usr/bin/mysqld_safe_helper from using the setgid capability. For complete SELinux messages. run sealert -l 640a7d54-35ab-43b5--db6f159e1449
Jan :: server python[]: SELinux is preventing /usr/bin/mysqld_safe_helper from using the setgid capability. ***** Plugin catchall (. confidence) suggests ************************** If you believe that mysqld_safe_helper should have the setgid capability by default.
Then you should report this as a bug.
You can generate a local policy module to allow this access.
Do
allow this access for now by executing:
# ausearch -c 'mysqld_safe_hel' --raw | audit2allow -M my-mysqldsafehel
# semodule -i my-mysqldsafehel.pp
通过以上日志可以看出SELinux阻止了mysqld_safe_helper 的行为,因此mysql服务启动失败是因为SELinux的权限问题。
为了获取更多信息,执行以下命令:
[root@server mysql]# sealert -a /var/log/audit/audit.log
SELinux is preventing /usr/bin/mysqld_safe_helper from using the setuid capability. ***** Plugin catchall (. confidence) suggests ************************** If you believe that mysqld_safe_helper should have the setuid capability by default.
Then you should report this as a bug.
You can generate a local policy module to allow this access.
Do
allow this access for now by executing:
# ausearch -c 'mysqld_safe_hel' --raw | audit2allow -M my-mysqldsafehel
# semodule -i my-mysqldsafehel.pp Additional Information:
Source Context system_u:system_r:mysqld_safe_t:s0
Target Context system_u:system_r:mysqld_safe_t:s0
Target Objects Unknown [ capability ]
Source mysqld_safe_hel
Source Path /usr/bin/mysqld_safe_helper
Port
Host
Source RPM Packages MariaDB-server-10.0.-.el7.centos.x86_64
Target RPM Packages
Policy RPM selinux-policy-3.13.-.el7_3..noarch
Selinux Enabled True
Policy Type targeted
Enforcing Mode Enforcing
Host Name server
Platform Linux server
3.10.-514.2..el7.x86_64 # SMP Tue Dec
:: UTC x86_64 x86_64
Alert Count
First Seen -- :: UTC
Last Seen -- :: UTC
Local ID f3462d4b-ed6b-4e94--7ab0970c0af0 Raw Audit Messages
type=AVC msg=audit(1484389402.769:): avc: denied { setuid } for pid= comm="mysqld_safe_hel" capability= scontext=system_u:system_r:mysqld_safe_t:s0 tcontext=system_u:system_r:mysqld_safe_t:s0 tclass=capability type=SYSCALL msg=audit(1484389402.769:): arch=x86_64 syscall=setuid success=no exit=EPERM a0=3e4 a1=3e4 a2=7f2c90e772e0 a3=7f2c90e772e0 items= ppid= pid= auid= uid= gid= euid= suid= fsuid= egid= sgid= fsgid= tty=(none) ses= comm=mysqld_safe_hel exe=/usr/bin/mysqld_safe_helper subj=system_u:system_r:mysqld_safe_t:s0 key=(null) Hash: mysqld_safe_hel,mysqld_safe_t,mysqld_safe_t,capability,setuid
根据以上建议,执行建议中的命令创建本地策略:
ausearch -c 'mysqld_safe_hel' --raw | audit2allow -M my-mysqldsafehel
semodule -i my-mysqldsafehel.pp
再次启动mysql服务,仍然失败。查看错误信息,仍是关于SELinux的:
SELinux is preventing /usr/bin/mysqld_safe_helper from using the setgid capability.
仍然按照以上步骤,执行建议命令。然后,再次重启mysql服务:
[root@server ~]# systemctl restart mysql
[root@server ~]# systemctl status mysql.service -l
â mysql.service - LSB: start and stop MySQL
Loaded: loaded (/etc/rc.d/init.d/mysql; bad; vendor preset: disabled)
Active: active (running) since Sat -- :: UTC; 29min ago
当然我们可以通过执行以下命令,通过临时关闭SELinux,解决这个问题:
setenforce
但是如果想要永久解决该问题,并保证系统的安全,还是建议通过添加SELinux策略的方式解决启动服务失败的问题。
/usr/bin/mysqld_safe_helper: Cannot change uid/gid (errno: 1) (转)的更多相关文章
- 安装Pod时提示ERROR: While executing gem ... (Errno::EPERM) Operation not permitted - /usr/bin/pod
环境:OSX EI 10.11.1 昨天切换gem源后,招待pod安装没有任何问题,也可以正常用$ gem sources --add https://ruby.taobao.org/ --remov ...
- ERROR: While executing gem ... (Errno::EPERM) Operation not permitted - /usr/bin/pod
因为突然要用到cocospod,突然发现在使用pod install的时候出现 -bash: pod: command not found 我去-不知道为什么,然后我就想重新安装下cocospod,在 ...
- sudo: /usr/bin/sudo must be owned by uid 0 and have the setuid bit set 的解决办法
Linux新建用户 ,sudo报错: sudo: /usr/bin/sudo must be owned by uid 0 and have the setuid bit set 解决办法:重置一下s ...
- 解决普通用户sudo时出现/usr/bin/sudo must be owned by uid 0 and have the setuid bit set
一:因为之前误操作使用sudo chmod -R 777 /usr命令修改了usr文件的所有者导致了此问题: 二:网上说需要进入recovery mode,经过自己的测试是不需要的: 三:步骤(只需登 ...
- sudo: /usr/bin/sudo must be owned by uid 0 and have the setuid bit set
使用root 登录,然后执行: chown root:root /usr/bin/sudo chmod 4755 /usr/bin/sudo reboot
- #!/System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/ruby
#!/System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/ruby # This script installs to ...
- 解决Ubuntu sudo apt-get install遇到的E: Sub-process /usr/bin/dpkg returned an error code (1)问题
如题,本人在安装samba等软件的时候,在命令行敲入: sudo apt-get install samba4命令的时候,系统在下载之后报错,大致内容如下: ~$ sudo apt-get insta ...
- 【问题】/usr/bin/env: php: 没有那个文件或目录
php不是默认安装的,在使用symfony创建新项目时,出现这个提示. [root@localhost html]# symfony demo /usr/bin/env: php: 没有那个文件或目录 ...
- /usr/bin/expect介绍
/usr/bin/expect介绍 http://blog.csdn.net/zhu_tianwei/article/details/44180637 概述 我们通过Shell可以实现简单的控制流功能 ...
随机推荐
- Linux下的软连接和硬链接
由于教学上的原因,需要下载Android源码,后来使用repo时,系统提示需要python2,我的系统中是两个都有的,但是默认是python3,无法下载,通过创建了个链接搞定,下面就来说说linux下 ...
- python 高阶函数和匿名函数
#!/usr/bin/env python # -*- coding:utf-8 -*- # @Time : 2017/11/02 22:46 # @Author : lijunjiang # @Fi ...
- C#图解教程学习笔记——转换
一.什么是转换转换(conversion)是指接受一个类型的值并使用它作为另一个类型的等价值的过程.转换后的值应和源值是一样的,但其类型为目标类型. 二.隐式转换和显式转换(强制转换)1. 隐式转换( ...
- poj 2892(二分+树状数组)
Tunnel Warfare Time Limit: 1000MS Memory Limit: 131072K Total Submissions: 7749 Accepted: 3195 D ...
- hdu 2669(扩展欧几里得)
Romantic Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Su ...
- TP5 多条件whereOr查询
问题背景:最近在用ThinkPHP 5开发项目的过程中,发现根据筛选条件做or查询的时候,连贯操作不可以使用where进行条件查询了. 首先列出一个user数据表的信息: uid uname grad ...
- Oracle 安装前准备
[root@localhost Desktop]# groupadd -g 110 oinstall 用来安装oracle软件 [root@localhost Desktop]# groupadd - ...
- CBIntrospector俗称:内部检查工具
Download View Introspector (CBIntrospector)内部检查工具是IOS和IOS模拟器的小工具集,帮助在调试的UIKit类的用户界面,它尤其有用于动态UI布局创建 ...
- 查询执行慢的SQL
--执行慢的SQL: SELECT S.SQL_TEXT, S.SQL_FULLTEXT, S.SQL_ID, ROUND(ELAPSED_TIME / 1000000 / (CASE WHEN (E ...
- C++面试试题汇总1
1.C和C++的主要区别是什么? 答:1.C++语言包括过程性语言部分和类部分,过程性语言部分与C并无本质的差别,类部分是C语言中所没有的,它是面向对象程序设计的主体. 2.程序设计方法上已从结构化程 ...