Failed to call ScheduleShutdown in logind, proceeding with immediate shutdown: Access denied
装了fedora23后定时关机:sudo shutdown -h +60
弹出如下信息后立刻就关机了:
Failed to call ScheduleShutdown in logind, proceeding with immediate shutdown: Access denied
Google一下,问题出在selinux。看下日志:
journalctl | grep -i avc
找到问题所在:
Nov :: RedBase audit[]: AVC avc: denied { create } for pid= comm="systemd-logind" name=".#scheduledKNqxuo" scontext=system_u:system_r:systemd_logind_t:s0 tcontext=system_u:object_r:init_var_run_t:s0 tclass=file permissive=
在/var/log/audit/audit.log中也找到相应信息:
# sudo audit2why < /var/log/audit/audit.log
type=AVC msg=audit(1448512017.541:): avc: denied { create } for pid= comm="systemd-logind" name=".#scheduledKNqxuo" scontext=system_u:system_r:systemd_logind_t:s0 tcontext=system_u:object_r:init_var_run_t:s0 tclass=file permissive=
Was caused by:
Missing type enforcement (TE) allow rule.
You can use audit2allow to generate a loadable module to allow this access.
那我们就使用audit2allow来生成相应模块来解决这个问题吧:
# cd /etc/selinux/targeted/policy
# grep systemd-logind /var/log/audit/audit.log | audit2allow -M mypol
# sudo semodule -i mypol.pp
搞定,这样在当前目录下就生成了两个文件:mypol.pp mypol.te,看看:
# vim mypol.te
#============= systemd_logind_t ==============
allow systemd_logind_t init_var_run_t:file create;
试验一下:
# sestatus
SELinux status: enabled
SELinuxfs mount: /sys/fs/selinux
SELinux root directory: /etc/selinux
Loaded policy name: targeted
Current mode: enforcing
Mode from config file: enforcing
Policy MLS status: enabled
Policy deny_unknown status: allowed
Max kernel policy version:
# shutdown -h +
Shutdown scheduled for Mon -- :: CST, use 'shutdown -c' to cancel.
Bingo!这样以后晚上工作没完成时,就可以让我的电脑多加一下班啦 :)
Failed to call ScheduleShutdown in logind, proceeding with immediate shutdown: Access denied的更多相关文章
- CDbConnection failed to open the DB connection: SQLSTATE[28000] [1045] Access denied for user 'root'@'localhost' (using password: YES)
连接mysql出错:CDbConnection failed to open the DB connection: SQLSTATE[28000] [1045] Access denied for u ...
- mysqladmin: connect to server at 'localhost' failed error: 'Access denied for user 'root'@'localhost' (using password: YES)'
就当作自己忘记Mysql密码把,忘记密码的解决方法 一.mysql登录错误mysqladmin: connect to server at 'localhost' failederror: 'Acce ...
- TortoiseGit拉取或推送,输入账号密码后提示 HTTP Basic: Access denied fatal: Authentication failed 解决方案
TortoiseGit拉取或推送项目,输入账号密码后,提示 HTTP Basic: Access denied fatal: Authentication failed. 大体意思是,HTTP基本认证 ...
- git Remote: HTTP Basic: Access denied Git failed with a fatal error.
解决方案: git clone 项目失败,报下面的错误信息: $ git clone http://192.168.0.141/xxxx.git Cloning into 'appEnterprise ...
- service mysqld start,Failed to start mysqld.service: Access denied
service mysqld start 然后报: ==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===Authentic ...
- 三星笔记本安装系统时报错:image failed to verify with * access denied* press any key to continue.
安装系统从光盘启动报错: 出现黑屏,并且有一个提示框image failed to verify with *access denied*press any key to continue 原因:三星 ...
- TortoiseGit拉取或推送项目提示 HTTP Basic: Access denied fatal: Authentication failed.
TortoiseGit拉取或推送项目提示 HTTP Basic: Access denied fatal: Authentication failed. 大体意思是,HTTP基本认证失败,访问被拒 ...
- xamarin调试android部署到模拟器错误记录:Deployment failed Mono.AndroidTools.InstallFailedException: Unexpected install output: Error: Could not access the Package Manager. Is the system running?
问题记录: 1.生成 ok. 2.昨天也是能部署到模拟器的. 但是今天部署的时候就报了这样的一个错误 Deployment failed Mono.AndroidTools.InstallFailed ...
- remote: http basic: access denied fatal: authentication failed for '‘解决办法
问题描述 由于这个项目代码使用https 进行clone,为什么?因为代码库ssh有问题!fuck! 导致在push代码的时候出现了 remote: http basic: access denied ...
随机推荐
- UVa1635 - Irrelevant Elements
通过观察发现其规律符合杨辉三角 需要注意的是最后ai的系数是C(i-1,n-1) 那么,问题就可以变成判断C(0,n-1),C(1,n-1)....C(n-1,n-1)哪些是m的倍数 只需要计算出m的 ...
- UVa1599,Ideal Path
说实话,这题参考的: http://blog.csdn.net/u013382399/article/details/38227917 倒着BFS就把我难住了T T,原来这样倒着BFS一遍,遍历完 ...
- Django之环境搭建以及初始配置
Django采用MVC架构,百度百科介绍如下: 全名Model View Controller,是模型(model)-视图(view)-控制器(controller)的缩写,一种软件设计典范,用一种业 ...
- Appium python自动化测试系列之滑动函数封装实战(八)
8.1 什么是函数的封装 教科书上函数的封装太官方,我们这里暂且将函数的封装就是为了偷懒把一些有共性的功能或者一些经常用的功能以及模块放在一起,方便我们以后再其他地方调用.这个只是个人的理解所以大家懂 ...
- Go 终极指南:编写一个 Go 工具
https://arslan.io/2017/09/14/the-ultimate-guide-to-writing-a-go-tool/ 作者:Fatih Arslan 译者:oopsguy.com ...
- 媲美jQuery的JS框架----AngularJS(二)
前言 对于AngularJS什么,小编在这就不多做介绍了.大家可以看小编的上一篇博客. 言归正传,小编在上一篇博客中介绍了AngularJS中的指令.表达式还有非常实用的三种服务.接下来,带大家看一看 ...
- 2017年编程语言排行榜Top10,第一名是?
关注 最近,IEEE Spectrum 杂志(美国电气电子工程师学会出版的旗舰杂志)发布了一年一度的编程语言排行榜,这也是他们发布的第四届编程语言 Top 榜.据介绍,IEEE Spectrum 的排 ...
- HDU1754 I hate it(线段树 单点修改)
好久没打线段树,来一道练练手,但说句实话,I really hate it!!!! 很多学校流行一种比较的习惯.老师们很喜欢询问,从某某到某某当中,分数最高的是多少. 这让很多学生很反感. 不管 ...
- hdu 1520 Anniversary party(入门树形DP)
Anniversary party Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 6926 Accepted: 3985 ...
- 利用 pandas 进行数据的预处理——离散数据哑编码、连续数据标准化
数据的标准化 数据标准化就是将不同取值范围的数据,在保留各自数据相对大小顺序不变的情况下,整体映射到一个固定的区间中.根据具体的实现方法不同,有的时候会映射到 [ 0 ,1 ],有时映射到 0 附近的 ...