From cc846f64b454e124d85256a112f977946b7e1896 Mon Sep 17 00:00:00 2001 From: Pierre de La Morinerie Date: Tue, 10 Oct 2017 17:04:43 +0530 Subject: [PATCH] Fix logs location The log location used to be a filename, but it is now a path since Mattermost 3.8. Having a path was tolerated in Mattermost <= 4.1, but crashes the server starting from Mattermost 4.2.0. --- scripts/install | 2 +- scripts/upgrade | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index d69217f..106e8ca 100644 --- a/scripts/install +++ b/scripts/install @@ -107,7 +107,7 @@ sudo sed -i "s|\"SMTPServer\": \"\"|\"SMTPServer\": \"localhost\"|g" sudo sed -i "s|\"SMTPPort\": \"\"|\"SMTPPort\": \"25\"|g" $final_path/config/config.json sudo sed -i "s|\"EnableConsole\": true|\"EnableConsole\": false|g" $final_path/config/config.json -sudo sed -i "s|\"FileLocation\": \"\"|\"FileLocation\": \"/var/log/mattermost.log\"|g" $final_path/config/config.json +sudo sed -i "s|\"FileLocation\": \"\"|\"FileLocation\": \"/var/log\"|g" $final_path/config/config.json if [ $analytics -eq 0 ]; then sudo sed -i "s|\"EnableDiagnostics\": true|\"EnableDiagnostics\": false|g" $final_path/config/config.json fi diff --git a/scripts/upgrade b/scripts/upgrade index 1887036..7345187 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -51,6 +51,10 @@ sudo rm -f "$archive_filename" # Restore configuration file sudo cp -f "$backup_config_file" "$config_file" +# Fix log FileLocation path (changed in Mattermost 3.8, makes Mattermost >= 4.2 crash) +# https://docs.mattermost.com/administration/changelog.html#release-v3-8-3 +sudo sed -i "s|\"FileLocation\": \"/var/log/mattermost.log\"|\"FileLocation\": \"/var/log\"|g" "$config_file" + # Restore file permissions sudo chown -R www-data: "$final_path"