/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可以实现简单的控制流功能 ...
随机推荐
- why not ovp protection ?
HW MSM8917 PM8937 PMI8940 Question : Recently, I connect usb cable with 10V to the phone. Why does t ...
- mac 重置mysql root密码
1. 关闭mysql服务 sudo /usr/local/mysql/support-files/mysql.server stop 如果出现Starting mysqld daemon with d ...
- [Oracle] 某游戏大区DB IO负载过高分析
某游戏大区DB IO负载过高分析 [问题] 下图信息看出机器IO负载过高, IO使用率: 平均值 50%, 峰值 98%, 业务高峰时间段(19:00-22:00)IO使用率持续80%以上. [分析] ...
- html框架集
通过框架集的使用定义页面分布 <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> ...
- LeetCode OJ--Multiply Strings **
https://oj.leetcode.com/problems/multiply-strings/ 用字符串实现大数乘法,细节题,细节很多 class Solution { public: stri ...
- 在Android 7.0以上PopupWindow.showAsDropDown()不起作用问题
最近优化界面,调用PopupWindow.showAsDropDown()发现,窗口并没有在控件下方显示. 有网友说是7.0以上系统的问题,可以自定义PopupWindow,重写showAsDropD ...
- 【IDEA】(3)---非常实用提高开发效率和水平的插件
IDEA(3)-Mac中IDEA插件 IDEA提供了许多很实用的插件,能够大大提高开发效率和开发水平,这里列举几个很实用的插件. 说明:这边的IDEA是MAC系统. 一.插件管理界面简介 1.界面位置 ...
- 巧用chrome开发者工具
说明:截图中的Chrome版本为52,不同版本可能略有区别. 常用设置 开发时消除静态资源缓存不能立刻更新的困扰,勾选Disable cache即可 切换颜色显示格式 修改默认颜色显示格式,在Sett ...
- Using Blocks in iOS 4: Designing with Blocks
In the first part of this series, we learned how to declare and call basic Objective-C blocks. The m ...
- Android Retrofit使用教程(三):Retrofit与RxJava初相逢
上一篇文章讲述了Retrofit的基本使用,包括GET,POST等请求.今天的文章中Retrofit要与RxJava配合使用. 了解RxJava RxJava有种种好处,我不在这里一一讲述.这里我只给 ...