zuntan02のはてなブログ

備忘録的なものです。時々職場の技術者ブログにも転記してますが、メインはこちらで。

【AmazonLinux+Mattermost4.8.0】初期プラグイン(ZOOM/JIRA)が有効にならない件

【問題】

[システムコンソール]-[プラグイン(ベータ版)]-[設定]で有効にしてもプラグインがつかえない。
インストールされていないのかと思ってtgz拾ってきてアップロードしようとすると「プラグインは無効化されています」と言われる。
アプリケーションログ(/opt/mattermost/log以下)を見ると

[2018/04/04 19:42:05 JST] [EROR] failed to start up plugins: mkdir ./client/plugins: no such file or directory
[2018/04/04 19:42:06 JST] [EROR] /api/v4/plugins:GetPlugins code=501 rid=(中略) Plugins have been disabled. [details: ]

みたいなログ。

【解決】

vi /etc/init.d/mattermost

SERVICE=mattermost
start() {
    cd /opt/mattermost/bin
    sudo -u mattermost ./platform > /dev/null &
    echo "service $SERVICE [start]"

を以下の様に変更

SERVICE=mattermost
start() {
    cd /opt/mattermost/
    sudo -u mattermost ./bin/platform > /dev/null &
    echo "service $SERVICE [start]"
}

【情報】

https://github.com/mattermost/docs/blob/master/source/administration/plugins.rst
曰く
the working directory for the service running Mattermost is not correct.
This can be fixed on Ubuntu 16.04 and RHEL by opening the service configuration file and setting WorkingDirectory to the path to Mattermost, often /opt/mattermost.

mattermost.log見ると

[2018/04/04 19:47:46 JST] [INFO] 現在のワーキングディレクトリーは/opt/mattermost/binです

なので、最初のcdを/opt/mattermostにしてやればよかった。
ググっても殆どヒットしないのでニッチな情報だと思いますが、誰かの役に立てば。。。