Changeset - fef0ccbac5f1
[Not reviewed]
0 1 0
Lance Edgar - 5 years ago 2019-09-22 20:15:15
lance@edbob.org
Always make backup config owned by 'root' user

instead of the `user` specified by caller, since we'll always expect to run the
actual backup commands as root
1 file changed with 2 insertions and 1 deletions:
0 comments (0 inline, 0 general) First comment
rattail_fabric2/backup.py
Show inline comments
 
@@ -97,7 +97,8 @@ def deploy_backup_app(c, deploy, envname, mkvirtualenv=True, user='rattail',
 

	
 
        # config
 
        c.sudo("bash -l -c 'workon {} && cdvirtualenv && rattail make-appdir'".format(envname), user=user)
 
        deploy(c, config, os.path.join(envpath, 'app/rattail.conf'), owner=user, mode='0600', use_sudo=True, context=context)
 
        # note, config is owned by root regardless of `user` - since we always run backups as root
 
        deploy(c, config, os.path.join(envpath, 'app/rattail.conf'), owner='root', mode='0600', use_sudo=True, context=context)
 
        c.sudo("bash -l -c 'workon {} && cdvirtualenv && bin/rattail -c app/rattail.conf make-config -T quiet -O app/'".format(envname), user=user)
 
        c.sudo("bash -l -c 'workon {} && cdvirtualenv && bin/rattail -c app/rattail.conf make-config -T silent -O app/'".format(envname), user=user)
 

	
0 comments (0 inline, 0 general) First comment
You need to be logged in to comment. Login now