helpers2.1: in logrotate, make sure to also chown $app the log dir

This commit is contained in:
Alexandre Aubin 2024-06-28 20:21:56 +02:00
parent 9cd7c86641
commit 1dfc47d1d7

View file

@ -24,9 +24,11 @@ ynh_config_add_logrotate() {
for stuff in $logfile
do
mkdir --parents $(dirname "$stuff")
# Make sure the permissions of the parent dir are correct (otherwise the config file could be ignored and the corresponding logs never rotated)
chmod 750 $(dirname "$stuff")
local dir=$(dirname "$stuff")
mkdir --parents $dir
chmod 750 $dir
chown $app:$app $dir
done
local tempconf="$(mktemp)"