ecs agent does not start with cis hardened linux
Has anyone come across this issue before:
[root@ip- ecs]# more ecs-init.log.2016-06-06-17 2016-06-06T17:53:10Z [INFO] pre-start 2016-06-06T17:53:10Z [INFO] Downloading Amazon EC2 Container Service Agent 2016-06-06T17:53:10Z [DEBUG] Downloading published md5sum from https://s3.amazonaws.com/amazon-ecs-agent/ecs-agent-v1.10.0.tar.md5 2016-06-06T17:53:10Z [DEBUG] Downloading Amazon EC2 Container Service Agent from https://s3.amazonaws.com/amazon-ecs-agent/ecs-agent-v1.10.0.tar 2016-06-06T17:53:10Z [DEBUG] Temp file /tmp/ecs-agent.tar806392739 2016-06-06T17:53:10Z [DEBUG] Expected 33b1f9252f395034e3e62b25a08b002a 2016-06-06T17:53:10Z [DEBUG] Calculated 33b1f9252f395034e3e62b25a08b002a 2016-06-06T17:53:10Z [DEBUG] Attempting to rename /tmp/ecs-agent.tar806392739 to /var/cache/ecs/ecs-agent.tar 2016-06-06T17:53:10Z [ERROR] could not download Amazon EC2 Container Serivce Agent: rename /tmp/ecs-agent.tar806392739 /var/cache/ecs/ecs-agent.tar: invalid cross-device link
Thanks!
Hello, @cchalouxmm, thanks for reporting this issue. Are you mounting /var and /tmp on different partitions or different disks? ecs-init downloads the file to /tmp and then attempts to rename it as a file in /var. If /var and /tmp are on different partitions or disks, a simple rename won't work as the file must actually be copied. If you are actually using /var and /tmp from different partitions or disks, can you try mounting them to the same partition instead?
@cchalouxmm Are you still experiencing problems here?
Yes the issue is still open. I think AWS Dev team has identified this as an issue as well and they said that it would be addressed in a future release.
Thank you!
@cchalouxmm can you respond to @juanrhenals question whether /var and /tmp are on different partitions or disks?
Thanks
I am looking at this issue as well - it appears they are on different volumes. Is there a workaround for this?
@crania At this point they need to be on the same volume. I've just opened https://github.com/aws/amazon-ecs-init/pull/50 to download the agent tarball directly into the cache directory at /var/cache/ecs so there is no problem renaming the file.
@crania this should be fixed with the new version of ecs-init released today. I'm closing this for now. Feel free to reopen/create a new issue if you still run into this issue.