How start a plugin as a service within Mattermost
-
Aren't mattermost server plugins automatically started by mattermost itself as a child process - https://developers.mattermost.com/integrate/plugins/server/ ?
-
Ah, I see, looks like mail2man is not a plugin, it is some sort of service that is run in the background?
A 'hack' is to have a cron task run every 5 minutes or so to start the service - https://docs.cloudron.io/apps/#cron . Add a script like https://www.akamaras.com/linux/linux-script-to-check-if-a-service-is-running-and-start-it-if-its-stopped/
-
@robi oh yeah of course, but it is very easy and and I could have actually thought of it myself.
#!/bin/bash cd /app/data/plugins/mail2most ./mail2most -c ./mail2most.conf
This script runs with cron every five minutes to check my mails and send them to the different channels. I have 5 addresses configured and it works fine.