Update data/helpers.d/logrotate

This commit is contained in:
Alexandre Aubin 2021-10-07 10:33:33 +02:00 committed by GitHub
parent 93a72a7b5f
commit bde5590783
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -97,8 +97,10 @@ EOF
mkdir --parents $(dirname "$logfile") # Create the log directory, if not exist
cat ${app}-logrotate | $customtee /etc/logrotate.d/$app > /dev/null # Append this config to the existing config file, or replace the whole config file (depending on $customtee)
ynh_user_exists --username="$app" || chown $app:$app "$logfile"
chmod o-rwx "$logfile"
if ynh_user_exists --username="$app"; then
chown $app:$app "$logfile"
chmod o-rwx "$logfile"
fi
}