# HG changeset patch # User Chris Cannam # Date 1503484337 -3600 # Node ID 073a75bf07fb37b91549bb40b125e5c19e8fc7be # Parent eeacb8332051ce7972677376323fdd9097988c9b Pull out directory creation to its own script, fix ownership diff -r eeacb8332051 -r 073a75bf07fb deploy/provision.d/115-other-dirs.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/deploy/provision.d/115-other-dirs.sh Wed Aug 23 11:32:17 2017 +0100 @@ -0,0 +1,31 @@ +#!/bin/bash + +set -e + +# Initialise directories used as targets for cron activity (if they +# don't already exist) + +# Reminder: the webapp directory is owned and run by the code user, in +# group www-data. The repos and other things served directly are +# usually the other way around -- owned by the www-data user, in group +# code. I don't recall whether there is a good reason for this. + +for dir in \ + /var/files/backups \ + /var/doc \ + /var/files/git-mirror ; do + if [ ! -d "$dir" ]; then + mkdir -p "$dir" + chown -R code.www-data "$dir" + chmod g+s "$dir" + fi +done + +for dir in \ + /var/mirror ; do + if [ ! -d "$dir" ]; then + mkdir -p "$dir" + chown -R www-data.code "$dir" + chmod g+s "$dir" + fi +done diff -r eeacb8332051 -r 073a75bf07fb deploy/provision.d/140-cron.sh --- a/deploy/provision.d/140-cron.sh Fri Aug 18 22:02:54 2017 +0100 +++ b/deploy/provision.d/140-cron.sh Wed Aug 23 11:32:17 2017 +0100 @@ -2,20 +2,6 @@ set -e -# Initialise directories used as targets for cron activity (if they -# don't already exist) - -for dir in \ - /var/files/backups \ - /var/doc \ - /var/files/git-mirror ; do - if [ ! -d "$dir" ]; then - mkdir -p "$dir" - chown -R code.www-data "$dir" - chmod g+s "$dir" - fi -done - # Copy cron scripts to the appropriate destinations cd /var/www/code