在使用su命令的时候报错”Failed to open temporary lock”

摘要:在Linux系统下使用su – user 命令时候,出现了报错“Failed to open temporary lock”该如何解决呢?…

在Linux系统下使用su – user 命令时候,出现了报错“Failed to open temporary lock”该如何解决呢?
报错信息:

# su - user CASCU092E Failed to open temporary lock file (Diagnostic information: 2). CASCU092E Failed to open temporary lock file (Diagnostic information: 2). CASCU092E Failed to open temporary lock file (Diagnostic information: 2). CASCU092E Failed to open temporary lock file (Diagnostic information: 2). CASCU092E Failed to open temporary lock file (Diagnostic information: 2). 

解决方案

我们使用strace命令追踪输出的过程中可以看到如下信息:


access("/tmp", W_OK|X_OK) = -1 EACCES (Permission denied) <0.000017> access("/tmp", W_OK|X_OK) = -1 EACCES (Permission denied) <0.000015 open("/tmp/AIM57432", O_WRONLY|O_CREAT, 061001320) = -1 EACCES (Permission denied) <0.000023 write(2, "CASCU092E Failed to open temporary lock file (Diagnostic information: 2).\n", 74) = 74 <0.000022> 

出现该问题是因为无法使用适当的权限写入/tmp,因此去查看其它正常的操作系统此目录具有Sticky Bit权限。因此该问题可以通过如下两种方式解决:

#chmod 1777 /tmp

或者

#chmod a+trwx /tmp
运维指南

相关文章

发表评论

登录后参与评论

登录或注册账号,与作者和其他读者互动交流