关于selinux 的配置上的疑问

bandaoyu 2014-09-26 09:46:29
mysql 的原安装目录是 /var/lib/mysql

我把它拷贝迁移至 /app/dat/mysql ,并将原来的备份为 /var/lib/mysql_bak 然后建立链接 /var/lib/mysql 链接至 /app/dat/mysql


并且使用命令 chcon --reference /var/lib/mysql_bak /app -R 将mysql的安全上下文全部都给了 新目录,

可是启动mysql的时候,仍然被selinux 拦截了,是denied {write} 是写被拦截了?

真是很奇怪,安全上下文已经全部和原来的/var/lib/mysql 一样了,为何还被拦截了?
...全文
631 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复
as an IT person, I believe that nothing is impossible. But u should probably ask yourself, at what cost?
  • 打赏
  • 举报
回复
引用 4 楼 bandaoyu 的回复:
[quote=引用 3 楼 micropentium6 的回复:] I have told u to check audit.log, have u done that yet? What is ur discovery there? Solving selinux issue is always pain in the ass, if u can not provide detail, no one can offer u specific...
这个具体性的问题,我就不问你了。这样,你能否告诉我如何关掉selinux对某一个特定的程序的监视吗?比如我想让selinux对mysql的一切操作都放行,但是对其他的程序还是该怎么样就怎么样。如何实现。 网上查找到的资料都是说用getsebool 命令 找到 mysqld_disable_trans 策略,然后关掉,但是我用getsebool -a|grep mysql却仅仅找到了:mysql_connect_any 和 allow_user_mysql_connect 两个,只看到这两个。没有找到mysqld_disable_trans [/quote] no way. boolean value is not the only constraint that could affect selinux's behavior, there are also file attributes, policies, etc. There is no swtich saying simply disable selinux toward a particular process. That's why I told u that you should provide specific details... From IT management perspective, if I were in this situation, my first choice will be migrate this mysql instance to another server and then rebuild this one. I am not going to waste my time on figuring out some SELinux details if I don't have an expert in the team. Remember what I told you at the first place: a lot of senior admin simply disable selinux. U don't have to trust me, try ur question at chinaunix.net and see what those "expert" say. I am confident that you will get the similar replies...
bandaoyu 2014-09-29
  • 打赏
  • 举报
回复
引用 3 楼 micropentium6 的回复:
I have told u to check audit.log, have u done that yet? What is ur discovery there? Solving selinux issue is always pain in the ass, if u can not provide detail, no one can offer u specific...
这个具体性的问题,我就不问你了。这样,你能否告诉我如何关掉selinux对某一个特定的程序的监视吗?比如我想让selinux对mysql的一切操作都放行,但是对其他的程序还是该怎么样就怎么样。如何实现。 网上查找到的资料都是说用getsebool 命令 找到 mysqld_disable_trans 策略,然后关掉,但是我用getsebool -a|grep mysql却仅仅找到了:mysql_connect_any 和 allow_user_mysql_connect 两个,只看到这两个。没有找到mysqld_disable_trans
  • 打赏
  • 举报
回复
see, I told u! I am pretty confident if I say no, no one can say yes for this issue you either dig into audit.log and make ur own policy override or move it back...
  • 打赏
  • 举报
回复
I have told u to check audit.log, have u done that yet? What is ur discovery there? Solving selinux issue is always pain in the ass, if u can not provide detail, no one can offer u specific...
bandaoyu 2014-09-26
  • 打赏
  • 举报
回复
引用 1 楼 micropentium6 的回复:
see, I told u! I am pretty confident if I say no, no one can say yes for this issue you either dig into audit.log and make ur own policy override or move it back...
引用 1 楼 micropentium6 的回复:
see, I told u! I am pretty confident if I say no, no one can say yes for this issue you either dig into audit.log and make ur own policy override or move it back...
i don't know how to movie it out , i can‘t found the policy. could you help me? how should i to deal with this problem ?
课程简述  Android是目前最为流行的移动操作系统之一,它的开发涉及到多个知识领域。本课程将深入介绍Android系统启动过程中的重要组成部分——init进程,并探讨与之相关的多项关键技术。我们还将提供实际的开发案例,以RK3399开发板为例,通过演示Android产品配置、init启动流程、selinux权限管理、init.rc启动脚本定制等实际案例,让学员深入理解这些技术在实际产品开发中的应用场景和实现方法,提高学员的实际开发能力和经验,从而更好地应对实际产品开发中遇到的问题和挑战。知识运用方向学习Android启动方面的知识,可以参与如下实际开发工作项:启动流程定制: 根据产品需求调整Android启动流程,包括修改init.rc脚本、修改启动顺序和等待时间、加入自定义服务等。属性系统定制: 通过Android属性系统定制化启动流程,例如增加产品版本信息、定制开机音量等。日志系统分析: 掌握日志的捕捉、分析和排错技术,在启动过程中,需要加入调试信息来方便开发人员进行调试,同时需要进行日志的优化,避免日志输出过多占用过多的系统资源。selinux安全策略定制:在Android系统中,selinux是一种安全机制,用于保护系统的敏感资源和数据。在实际开发中,可能需要对selinux策略进行定制,以确保系统的安全性和稳定性。课程内容主要内容简述1, RK3399 开发板操作这部分内容重点介绍如何在FIreFly开发板上将Android 10系统运行起来, 包含编译FireFly的Android源码下载和编译, 镜像烧录运行,内核和模块编译,以及RK3399内核启动init进程的过程。2, 产品定制这部分讲解获取到方案商或者原厂提供的源码后, 如何定制一个新的产品,产品配置文件和模型, 原始代码中的配置文件和定制化东西3, Android日志代码编写之前讲过Android的日志系统, 并没涉及到代码编写, 这个部分重点讲解C/C++, java代码编写日志的API和代码4, 属性系统在Android中,属性使用的非常频繁的,可以用来作为进程间通信,也可以用于一些行为控制, 这个部分会重点介绍属性系统框架, API接口, 属性文件等知识点5,selinux进程对文件进行访问时,Android 4.3就开始集成了selinux权限管控, 如果需要启动某个脚本或者服务, selinux配置就避免不了,并且Android8之后, Android系统对进程访问的权限管控的非常严格。6, init.rc脚本Android定义的一种脚本, 改脚本是有init进程启动, 是非常重要的一个脚本, 会包含系统中的其他很多脚本, 在我们系统开发时, 我们经常通过这个脚本进行一些定制化动作。7, init进程代码分析想要了解一个系统,就必须对源码进行分析和理解, 这个章节,带大家去跟读init进程代码, 这样,换了另外一个Android版本,完全就可以去读代码, 知道有什么变化。 

1,543

社区成员

发帖
与我相关
我的任务
社区描述
Linux/Unix社区 Solaris
社区管理员
  • Solaris
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧