logrotate: fix generated config file perms (#1736)

* fix generated logrotate config file perms

* apply perms to the right file (I'm so tired lmao)

* fix indent

* update docs

* revert: wrong branch 😭

---------

Co-authored-by: OniriCorpe <OniriCorpe@users.noreply.github.com>
This commit is contained in:
OniriCorpe 2023-11-20 19:01:33 +01:00 committed by GitHub
parent 38469accee
commit 300c999a5a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -99,6 +99,7 @@ $logfile {
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)
chmod 644 "/etc/logrotate.d/$app" # Make sure permissions are correct (otherwise the config file could be ignored and the corresponding logs never rotated)
}
# Remove the app's logrotate config.