【标题描述】sa-update.service服务首次启动之后,日志中有报错:gpg: can't connect to the agent: IPC connect call failed
【环境信息】
软件信息:
1) OS版本及分支:openEuler 22.03 (LTS-SP1)
2) 内核信息:5.10.0-126.0.0.66.oe2203sp1.x86_64
3) 发现问题的组件版本信息:spamassassin-3.4.5-3.oe2203sp1.x86_64
【问题复现步骤】
具体操作步骤
dnf install -y spamassassin
systemctl start spamassassin.service
systemctl start sa-update.service
systemctl status sa-update.service
出现概率(是否必现,概率性错误):偶现
【预期结果】
服务启动成功,日志无异常
【实际结果】
服务启动之后,日志中有打印异常信息,如下图所示:
【附件信息】
比如系统message日志/组件日志、dump信息、图片等
Hi wenjunryou, welcome to the openEuler Community.
I'm the Bot here serving you. You can find the instructions on how to interact with me at Here.
If you have any questions, please contact the SIG: Application, and any of the maintainers: @Alex_Chao , @small_leek , @jimmy_hero , @朱春意 , @caodongxia
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。
偶现问题复现方法 (打开selinux的情况)
systemctl stop sa-update.service
rm -rf /etc/mail/spamassassin/sa-update-keys/*
systemctl start sa-update.service
systemctl status sa-update.service
原因分析:第一次启动 sa-update服务时,会在/etc/mail/spamassassin/sa-update-keys/ 目录下创建连接gpg-agent的可信文件,用于认证连接gpg-agent deamon。环境中没有预安装用于认证的软件包systemd-pam,所以连接失败。
规避方法:
1.执行setenforce 0 再执行此操作无问题。(关闭selinux)
解决方法:
预安装systemd-pam软件包(增加安装依赖的话,需要通过ssh重新登陆才能生效)。
补充:
经讨论systemd-pam预装到环境中有如下影响:
预装systemd-pam会使openEuler每次用户登录,systemd都为他们创建对应的user@UID.service等,生成对应的session-.scope。这个功能的正常生效需要dbus、systemd-logind同时无问题,一旦任意一个组件出问题都可能会导致登录超时25s。此外用户拉起的进程cgroup会被迁移到session-.scope下管理,可能影响用户的进程cpu、memory等cgroup子系统配置。因此建议不要预装。
来源pr:https://gitee.com/src-openeuler/oemaker/pulls/201
因此,不预装systemd-pam, 在spamassassin中声明安装依赖systemd-pam。安装spamassassain后,退出shell会话,ssh重新登陆后使用sa-update服务。 讨论人 @lyn @licunlong @DisNight
回归方法:
1.dnf install -y spamassassin
2.退出shell会话,ssh重新登陆
3.systemctl start spamassassin.service
4.systemctl start sa-update.service
5.systemctl status sa-update.service
备注:需要重新登陆的原因是:安装systemd-pam子包之后,重新登录才会走systemd创建会话流程
【验收环境】
软件信息:
1) OS版本及分支:openEuler 22.03 (LTS-SP1)
2) 内核信息:5.10.0-136.3.0.77.oe2203sp1
3) 验收问题的组件版本信息:spamassassin-3.4.5-4.oe2203sp1
【验收结果】
1.dnf install -y spamassassin
2.退出shell会话,ssh重新登陆
rm -rf /etc/mail/spamassassin/sa-update-keys/*
3.systemctl start spamassassin.service
4.systemctl start sa-update.service
5.systemctl status sa-update.service
服务启动之后,日志无异常,问题验收通过
登录 后才可以发表评论