|
@ -2,17 +2,23 @@ |
|
|
|
|
|
|
|
|
## Should be executable N time in a row with same result. |
|
|
## Should be executable N time in a row with same result. |
|
|
|
|
|
|
|
|
. lib/common |
|
|
|
|
|
|
|
|
|
|
|
set -e |
|
|
set -e |
|
|
|
|
|
|
|
|
uid=$(docker_get_uid "$SERVICE_NAME" "rsync") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
uid_gid=$(docker_get_uid_gid "$SERVICE_NAME" "rsync" "rsync") |
|
|
|
|
|
uid=${uid_gid%%$'\n'*} |
|
|
|
|
|
gid=${uid_gid#*$'\n'} |
|
|
|
|
|
|
|
|
LOGS=/var/log/rsync |
|
|
LOGS=/var/log/rsync |
|
|
|
|
|
|
|
|
mkdir -p "$SERVICE_DATASTORE/$LOGS" |
|
|
mkdir -p "$SERVICE_DATASTORE/$LOGS" |
|
|
|
|
|
|
|
|
touch "$SERVICE_DATASTORE/$LOGS/ssh-cmd-validate.log" |
|
|
touch "$SERVICE_DATASTORE/$LOGS/ssh-cmd-validate.log" |
|
|
chown -v "$uid" "$SERVICE_DATASTORE/$LOGS" "$SERVICE_DATASTORE/$LOGS/ssh-cmd-validate.log" |
|
|
chown -v "$uid" "$SERVICE_DATASTORE/$LOGS" "$SERVICE_DATASTORE/$LOGS/ssh-cmd-validate.log" |
|
|
|
|
|
chmod -v 0640 "$SERVICE_DATASTORE/$LOGS/ssh-cmd-validate.log" |
|
|
|
|
|
|
|
|
|
|
|
touch "$SERVICE_DATASTORE/$LOGS/ssh-admin-cmd-validate.log" |
|
|
|
|
|
chown -v "$uid:$gid" "$SERVICE_DATASTORE/$LOGS" "$SERVICE_DATASTORE/$LOGS/ssh-admin-cmd-validate.log" |
|
|
|
|
|
chmod -v 0660 "$SERVICE_DATASTORE/$LOGS/ssh-admin-cmd-validate.log" |
|
|
|
|
|
|
|
|
rotated_count=$(relation-get rotated-count 2>/dev/null) || true |
|
|
rotated_count=$(relation-get rotated-count 2>/dev/null) || true |
|
|
rotated_count=${rotated_count:-52} |
|
|
rotated_count=${rotated_count:-52} |
|
@ -33,7 +39,9 @@ file_put "$DST" <<EOF |
|
|
compress |
|
|
compress |
|
|
delaycompress |
|
|
delaycompress |
|
|
notifempty |
|
|
notifempty |
|
|
create 640 $uid |
|
|
|
|
|
|
|
|
## XXXvlab: see https://github.com/logrotate/logrotate/issues/650 |
|
|
|
|
|
## for the syntax headache (and it relies on correct version of logrotate) |
|
|
|
|
|
create 0640 :$uid :0 |
|
|
sharedscripts |
|
|
sharedscripts |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -49,7 +57,9 @@ file_put "$DST" <<EOF |
|
|
compress |
|
|
compress |
|
|
delaycompress |
|
|
delaycompress |
|
|
notifempty |
|
|
notifempty |
|
|
create 660 $uid |
|
|
|
|
|
|
|
|
## XXXvlab: see https://github.com/logrotate/logrotate/issues/650 |
|
|
|
|
|
## for the syntax headache (and it relies on correct version of logrotate) |
|
|
|
|
|
create 0660 :$uid :$gid |
|
|
sharedscripts |
|
|
sharedscripts |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -65,7 +75,7 @@ file_put "$DST" <<EOF |
|
|
compress |
|
|
compress |
|
|
delaycompress |
|
|
delaycompress |
|
|
notifempty |
|
|
notifempty |
|
|
create 640 |
|
|
|
|
|
|
|
|
create 0640 :0 :0 |
|
|
sharedscripts |
|
|
sharedscripts |
|
|
} |
|
|
} |
|
|
EOF |
|
|
EOF |
|
|