13 Star 9 Fork 88

src-openEuler / systemd

 / 详情

timedatectl命令在执行一些时区服务操作后 尝试改变时区时报错

已完成
缺陷
创建于  
2020-12-07 15:36

输入图片说明

该问题的疑似定位原因是:systemd timedatectl中设置时区的相关源码有一个unlink的系统调用,当不采用systemd提供的方法设置时区而是直接用如问题单中的方法用软连接的方法设置时区,之后如果再使用timedatectl设置时区,这个unlik会因为SElinux使能而缺乏权限导致Acess denied的报错。使用audit2allow生成临时的.te策略文件,并插入之后该问题解决
输入图片说明

评论 (2)

buaixuebi 创建了缺陷
buaixuebi 关联仓库设置为src-openEuler/systemd
展开全部操作日志

Hey ruihongw, Welcome to openEuler Community.
All of the projects in openEuler Community are maintained by @openeuler-ci-bot.
That means the developers can comment below every pull request or issue to trigger Bot Commands.
Please follow instructions at https://gitee.com/openeuler/community/blob/master/en/sig-infrastructure/command.md to find the details.

version:20.03 LTS
#!/bin/bash
timedatectl set-ntp no
sleep 1
systemctl mask systemd-timesyncd.service
sleep 1
systemctl stop chronyd.service
sleep 1
systemctl mask chronyd.service
sleep 1
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
sleep 1
timedatectl set-ntp yes
sleep 1
systemctl unmask systemd-timesyncd.service
sleep 1
systemctl unmask chronyd.service
sleep 1
#systemctl status chronyd.service
#sleep 1
#systemctl status systemd-timesyncd
#sleep 1
timedatectl set-ntp yes
sleep 1
timedatectl set-ntp no
sleep 1
timedatectl set-timezone Asia/Shanghai
sleep 1
timedatectl set-ntp yes
sleep 1
timedatectl set-timezone Asia/Shanghai
sleep 1
timedatectl set-timezone Asia/Beijing
sleep 1
timedatectl set-timezone Asia/Beijing
sleep 1
timedatectl set-timezone Asia/Shanghai

登录 后才可以发表评论

状态
负责人
项目
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
预计工期 (小时)
参与者(2)
5329419 openeuler ci bot 1632792936
1
https://gitee.com/src-openeuler/systemd.git
git@gitee.com:src-openeuler/systemd.git
src-openeuler
systemd
systemd

搜索帮助