jeudi 1 mai 2014

Linux - modifier les autorisations de fichier à l'aide du fichier de configuration elasticbeanstalk - Stack Overflow


I have an application which is launched through AWS Elastic Beanstalk and Git. I recently learned about their config files and some of the actions you can perform with them.


I have some files which need to have specific permissions. When I do a git aws.push the permissions are changed.


One of the files is called,say foo.inc.php it's owner:group is webapp:webapp it's default permissions are 666. I want the permissions to be 644.


Here's what I have in my elb.config file:


"container_commands":{
"05-setperms":{
"command": "chmod 664 /var/app/current/baz/foo.inc.php"
},
"06-setperms":{
"command": "find /var/app/current/baz -name foo.inc.php -exec sudo chmod 644 {} \;"
},
"07-setperms":{
"command": "find /var/app/current/baz -name foo.inc.php -exec chmod 644 {} \;"
},
}`

(I left out commands which are working(starting cron jobs, etc))


These three commands are very similar, yet none of them seem to work. After the push and the environment update, the file is back to 666.


What can I do differently? I have other applications that could benefit from automatic permissions being set so I would really like to learn what's going wrong and how to fix it.


I'm on a Linux environment. I looked at this question and borrowed some of the code. The sparse AWS documentation is here


Thank you.




Found it! Thanks to an answer here by Ed Campion I got it working.


If you edit the /var/app/ondeck/file.ext it works!


Your file is ondeck as opposed to current



I have an application which is launched through AWS Elastic Beanstalk and Git. I recently learned about their config files and some of the actions you can perform with them.


I have some files which need to have specific permissions. When I do a git aws.push the permissions are changed.


One of the files is called,say foo.inc.php it's owner:group is webapp:webapp it's default permissions are 666. I want the permissions to be 644.


Here's what I have in my elb.config file:


"container_commands":{
"05-setperms":{
"command": "chmod 664 /var/app/current/baz/foo.inc.php"
},
"06-setperms":{
"command": "find /var/app/current/baz -name foo.inc.php -exec sudo chmod 644 {} \;"
},
"07-setperms":{
"command": "find /var/app/current/baz -name foo.inc.php -exec chmod 644 {} \;"
},
}`

(I left out commands which are working(starting cron jobs, etc))


These three commands are very similar, yet none of them seem to work. After the push and the environment update, the file is back to 666.


What can I do differently? I have other applications that could benefit from automatic permissions being set so I would really like to learn what's going wrong and how to fix it.


I'm on a Linux environment. I looked at this question and borrowed some of the code. The sparse AWS documentation is here


Thank you.



Found it! Thanks to an answer here by Ed Campion I got it working.


If you edit the /var/app/ondeck/file.ext it works!


Your file is ondeck as opposed to current


0 commentaires:

Enregistrer un commentaire