0

我有我的 logdna aws eb 配置文件,我添加了一个要通过我的 logdna 代理流式传输的文件,但我一直收到错误 'utime': Permission denied @ utime_internal - log/logstasher.log (Errno::EACCES)

在我的文件夹中,我看到 logstasher.log 文件在用户 webapp 下,所以我不确定这是否是问题,但我怎样才能摆脱错误?

commands:
  01_install_logdna:
    command: "/home/ec2-user/logdna.sh"
    test: '[[ $(/opt/elasticbeanstalk/bin/get-config environment -k RACK_ENV) = "develop" ]]'
  02_restart_logdna:
    command: "service logdna-agent restart"
    test: '[[ $(/opt/elasticbeanstalk/bin/get-config environment -k RACK_ENV) = "develop" ]]'

files:
  "/home/ec2-user/logdna.sh" :
    mode: "000777"
    owner: root
    group: root
    content: |
      #!/bin/sh
      RACK_ENV=$(/opt/elasticbeanstalk/bin/get-config environment -k RACK_ENV)
      echo "$RACK_ENV"
      if [ "$RACK_ENV" == "develop" ]
      then
        rpm --import https://repo.logdna.com/logdna.gpg
        cat >/etc/yum.repos.d/logdna.repo << 'EOL2'
      [logdna]
      name=LogDNA packages
      baseurl=https://repo.logdna.com/el6/
      enabled=1
      gpgcheck=1
      gpgkey=https://repo.logdna.com/logdna.gpg
      EOL2
        LOGDNA_INGESTION_KEY=$(/opt/elasticbeanstalk/bin/get-config environment -k LOGDNA_INGESTION_KEY)
        yum -y install logdna-agent
        logdna-agent -k $LOGDNA_INGESTION_KEY # this is your unique Ingestion Key
        # /var/log is monitored/added by default (recursively), optionally add more dirs here
        sudo chmod 777 /var/app/current/log/logstasher.log
        logdna-agent -d /var/app/current/log/logstasher.log
        logdna-agent -d /var/app/containerfiles/logs/sidekiq.log
        # logdna-agent --hostname allows you to pass your AWS env metadata to LogDNA (remove # to uncomment the line below)
        # logdna-agent --hostname `{"Ref": "AWSEBEnvironmentName" }`
        # logdna -t option allows you to tag the host with tags (remove # to uncomment the line below)
        #logdna-agent -t `{"Ref": "AWSEBEnvironmentName" }`
        chkconfig logdna-agent on
        service logdna-agent start
      fi
4

0 回答 0