For the purpose of rebuilding app, is there any way to make chown on /shared/uploads directory more efficient? Is there any workaround?
- mkdir -p tmp/pids
- mkdir -p tmp/sockets
- touch tmp/.gitkeep
- mkdir -p /shared/log/rails
- bash -c "touch -a /shared/log/rails/{production,production_errors,unicorn.stdout,unicorn.stderr,sidekiq}.log"
- bash -c "ln -s /shared/log/rails/{production,production_errors,unicorn.stdout,unicorn.stderr,sidekiq}.log $home/log"
- bash -c "mkdir -p /shared/{uploads,backups}"
- bash -c "ln -s /shared/{uploads,backups} $home/public"
- bash -c "mkdir -p /shared/tmp/{backups,restores}"
- bash -c "ln -s /shared/tmp/{backups,restores} $home/tmp"
- chown -R discourse:www-data /shared/log/rails /shared/uploads /shared/backups /shared/tmp
- exec:
cmd:
- "cp $home/config/nginx.sample.conf /etc/nginx/conf.d/discourse.conf"
- "rm /etc/nginx/sites-enabled/default"
- "mkdir -p /var/nginx/cache"
- replace:
filename: /etc/nginx/nginx.conf
from: pid /run/nginx.pid;
Currently this line alone takes more than 10 minutes (200.000+ uploads). Without it, rebuild would be reasonably quick.
5 个赞
I remember this coming up before @mpalmer is there any fancy “skip these files if the permissions on them already look correct” option for that command?
2 个赞
mpalmer
(Matt Palmer)
2020 年3 月 13 日 01:25
3
Yes, probably what caused this line to appear in web.template.yml:
find $home ! -user discourse -exec chown discourse {} \+
In this case, I think the command would be something like
find /shared/log/rails /shared/uploads /shared/backups /shared/tmp ! -user discourse -or ! -group www-data -exec chown discourse:www-data {} \+
3 个赞
Awesome, anything we can do to make it so?
1 个赞
system
(system)
关闭
2020 年4 月 12 日 02:47
5
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.