The lsyncd service runs as the 'nginx' user such that files sync'd
from the master node to the backups will have 'nginx' as the owner.
However, the apt-cacher-ng service needs to be the owner to function
properly. This fix consolidates the pre and post sync tasks into
a script that can be called by lsyncd. The script can then change
the file owners as needed before and after the rsync. The owners
need to be 'nginx' before the rsync so that lsyncd can update
files and 'apt-cacher-ng' after the sync so the cacher service works.
Additionally, setup lsyncd to sync each service's directory separately
rather than being rsync'd all together. This avoids lsyncd bouncing
services when their respective files are not being sync'd.
Backport modified to work with Upstart.
Change-Id: Ifaba17b89035398917f2b3257574e18eb9027c08
Closes-bug: #1649339
(cherry picked from commit 1169edc47be92943690983a6d10857761038b473)
Reviewed: https:/ /review. openstack. org/420773 /git.openstack. org/cgit/ openstack/ openstack- ansible- repo_server/ commit/ ?id=248b2d6c94b 0c9c963c0226c8d 6cb6c897a52520
Committed: https:/
Submitter: Jenkins
Branch: stable/newton
commit 248b2d6c94b0c9c 963c0226c8d6cb6 c897a52520
Author: Cameron Loader <email address hidden>
Date: Wed Jan 18 16:07:03 2017 -0600
Fix apt-cacher-ng file owners during rsync
The lsyncd service runs as the 'nginx' user such that files sync'd
from the master node to the backups will have 'nginx' as the owner.
However, the apt-cacher-ng service needs to be the owner to function
properly. This fix consolidates the pre and post sync tasks into
a script that can be called by lsyncd. The script can then change
the file owners as needed before and after the rsync. The owners
need to be 'nginx' before the rsync so that lsyncd can update
files and 'apt-cacher-ng' after the sync so the cacher service works.
Additionally, setup lsyncd to sync each service's directory separately
rather than being rsync'd all together. This avoids lsyncd bouncing
services when their respective files are not being sync'd.
Backport modified to work with Upstart.
Change-Id: Ifaba17b8903539 8917f2b3257574e 18eb9027c08 3690983a6d10857 761038b473)
Closes-bug: #1649339
(cherry picked from commit 1169edc47be9294