Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


    Cloudron Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular

    How start a plugin as a service within Mattermost

    Mattermost
    3
    6
    197
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • R
      roru2k20 last edited by

      Good evening,

      how can I start for example mail2most (send Mails to Mattermost) as a service within the app? I can run once in the terminal, but when I close the terminal it shutdown the plugin.

      Can I install it as normal service?

      1 Reply Last reply Reply Quote 0
      • girish
        girish Staff last edited by

        Aren't mattermost server plugins automatically started by mattermost itself as a child process - https://developers.mattermost.com/integrate/plugins/server/ ?

        1 Reply Last reply Reply Quote 0
        • girish
          girish Staff last edited by

          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/

          R 1 Reply Last reply Reply Quote 1
          • R
            roru2k20 @girish last edited by

            @girish that works well, but I have implemented it differently.

            Every five minutes runs the programm and send to Mattermost my mails from different inboxes.

            Thanks for help!

            robi 1 Reply Last reply Reply Quote 2
            • robi
              robi @roru2k20 last edited by

              @roru2k20 Would you mind posting your script so others can find it later? A bit of a how-to as this thread suggests 😉

              Life of Advanced Technology

              R 1 Reply Last reply Reply Quote 0
              • R
                roru2k20 @robi last edited by

                @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.

                1 Reply Last reply Reply Quote 1
                • First post
                  Last post
                Powered by NodeBB