大网数据广告活动
服务器运维问答

Rsyslog not able to read imfile from perforce directory

· 52CE 我爱测

I am facing an issue in an Ubuntu server where Rsyslog is not able to read any file from the Perforce logs directory. I tested that Rsyslog configuration for the imfile module is working properly since it is able to read from oth…

问题原文

原帖链接 · Notauser · CC BY-SA 4.0

I am facing an issue in an Ubuntu server where Rsyslog is not able to read any file from the Perforce logs directory.

I tested that Rsyslog configuration for the imfile module is working properly since it is able to read from other directories including /home.

I also added syslog user to perforce group and vice-versa but it still didn't work.

One workaround I found but obviously not suitable for production is to do something like:

tail -f /perforce/logs/log.csv >> /home/monitoredlogfile

some useful info :

drwxr----- 2 perforce perforce 4096 Jun 11 14:01 logs

id syslog uid=104(syslog) gid=108(syslog) groups=108(syslog),4(adm),1010(perforce)

id perforce uid=1010(perforce) gid=1010(perforce) groups=1010(perforce),108(syslog)

Any idea what could be going wrong ?

已采纳解答

原帖链接 · Skullone · CC BY-SA 4.0

Your perforce group can only read the repo /perforce/logs you need to add "x" to that folder to allow this group to access that folder.

Also be sure your /perforce folder has the same permission. Even if your /perforce/logs has rwxrwxrwx as persmission, if your /perforce is only rwx------ then the group won't never be able to access it.

If you don't want to play with the application permission you could use ACL instead to give access to syslog user to your folder

$ sudo setfacl -m u:syslog:rx -R /perforce/logs/ 
$ sudo getfacl /perforce/logs/

Careful : once I tried that with Kubernetes (giving access to syslog to /var/lib/docker/containers), but it broke new pods (they had DNS resolution issue). I had no other choice than run rsyslog as root instead of syslog

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2019-06-11)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。