我有一个试图写一些文件的Rails ActiveJob。当控制器调用权限时,它会失败,并返回上述错误,尝试按如下方式写入文件:Errno::/home/ec2-user/scrubarea/landing/5mBs8mq85ZFKVnqijeKZuNuh). (Permission denied @ rb_sysopen -EACCES
即使目录拥有777个权限,也会发生这种情况。
但是,如果我通过ssh进入EC2映像,访问Rails控制台,并使用perform_now运行作业,它就能正常工作。
是否有其他AWS安全机制不允许应用程序写入文件?
发布于 2018-02-02 11:46:27
commands:
01_set_scrubarea:
command: mkdir /var/tmp/scrubarea
ignoreErrors: true
05_set_landing:
command: mkdir /var/tmp/scrubarea/cleanpool
ignoreErrors: true
10_set_cleanpool:
command: mkdir /var/tmp/scrubarea/landing
ignoreErrors: true
15_change_security_scrubarea:
command: chmod 775 /var/tmp/scrubarea
17_change_security_cleanpool:
command: chmod 775 /var/tmp/scrubarea/cleanpool
19_change_security_landing:
command: chmod 775 /var/tmp/scrubarea/landing
20_change_owner:
command: chown --verbose --recursive ec2-user:ec2-user /var/tmp/scrubarea
25_add_to_group:
command: usermod -a -G ec2-user webapp
https://stackoverflow.com/questions/48536610
复制相似问题