Mattermost, Inc.

Single-server, CentOS 7 initial setup -- Won't launch as service

I’ll start off by saying that I’m a Windows / Storage admin. I’ve just been put on this project as a bit of a learning project, so my linux experience is very limited.

I’ve configured a single CentOS 7 server and have been following the RHEL 7 guide to the T. http://docs.mattermost.com/install/prod-rhel-7.html

I’ve gotten to Step 8 on Setup Mattermost Server.

It starts just fine if I run ./platform, but creating the service does not seem to work. How can I debug that service creation? Does RHEL and CentOS 7 differ in the aspect of services?

I get no errors when I type ‘service mattermost restart’, but I cannot connect to port 8065 unless I manually run ./platform.

Any help would be appreciated. I swear I’m a quick learner =)

Perhaps its this: in /etc/systemd/system/mattermost.service,
you have to define the correct directories that you’ve installed mattermost to. Also check for the User to be existing and having permissions to start the binaries

CentOS 7 is systemd-based. Try typing the following:

systemctl start mattermost
systemctl status matermost
1 Like

Thank you, this put me onto the right track. I think it’s the user that has been configured to run the service that’s causing the issue.

[root@localhost bin]# su mattermost
bash-4.2$ ./platform
FileLogWriter("/opt/mattermost/logs/mattermost.log"): open /opt/mattermost/logs/mattermost.log: permission denied
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x0 pc=0x5ec0fc]

goroutine 1 [running]:
github.com/mattermost/platform/utils.configureLog(0xc820149010)
/go/src/github.com/mattermost/platform/utils/config.go:101 +0x4ec
github.com/mattermost/platform/utils.LoadConfig(0xc820144990, 0x22)
/go/src/github.com/mattermost/platform/utils/config.go:162 +0x5f5
main.main()
/go/src/github.com/mattermost/platform/mattermost.go:54 +0x43

goroutine 17 [syscall, locked to thread]:
runtime.goexit()
/usr/local/go/src/runtime/asm_amd64.s:1696 +0x1

goroutine 5 [syscall]:
os/signal.loop()
/usr/local/go/src/os/signal/signal_unix.go:22 +0x18
created by os/signal.init.1
/usr/local/go/src/os/signal/signal_unix.go:28 +0x37

goroutine 7 [chan receive]:
code.google.com/p/log4go.ConsoleLogWriter.run(0xc820016c00, 0x7fb8401ab1e8, 0xc820024010)
/go/src/github.com/mattermost/platform/Godeps/_workspace/src/code.google.com/p/log4go/termlog.go:27 +0x80
created by code.google.com/p/log4go.NewConsoleLogWriter
/go/src/github.com/mattermost/platform/Godeps/_workspace/src/code.google.com/p/log4go/termlog.go:19 +0x6e

This fixed it:

[root@localhost mattermost]# cd …/logs/
[root@localhost logs]# chown -R mattermost:mattermost mattermost.log
[root@localhost logs]# chmod -R g+w mattermost.log