• Recent
    • Tags
    • Popular
    • Register
    • Login

    Please Note This forum exists for community support for the Mango product family and the Radix IoT Platform. Although Radix IoT employees participate in this forum from time to time, there is no guarantee of a response to anything posted here, nor can Radix IoT, LLC guarantee the accuracy of any information expressed or conveyed. Specific project questions from customers with active support contracts are asked to send requests to support@radixiot.com.

    Radix IoT Website Mango 3 Documentation Website Mango 4 Documentation Website Mango 5 Documentation Website

    Mango on Linux won't start under mango user, but will with root

    User help
    3
    9
    1.3k
    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.
    • cmusselmC
      cmusselm
      last edited by

      We have been running Mango on Windows for a couple years now and want to get a Linux server up and going.

      We have an Amazon Linux server with all the necessary software installed, and can start the instance using:

      sudo ./ma-sh start
      

      The problem is when we try to start the app using the mango user we get the following:

      [ec2-user@ip-xxx-xxx-xxx-xxx bin]$ sudo -u mango ./ma.sh start
      MA_HOME is /opt/mango
      [ec2-user@ip-xxx-xxx-xxx-xxx bin]$ ma-start: MA started with Process ID:  21478
      ma-start: no restart flag found, not restarting MA
      ma-start: MA done
      
      

      Some times we get more info on the error and it says:

      ERROR 2021-06-02T01:59:07,431 [main] - Error during initialization
      java.net.SocketException: Permission denied
      

      This seems like a permissions issue, but we're not sure where. /opt/openjdk has been changed to be owned by mango:mango as well as the /opt/mango directory structure.

      I've followed the steps in the Linux Install page: https://docs-v3.mango-os.com/linux-installation

      I've also followed the advice in this post https://forum.mango-os.com/topic/3278/java-update-to-1-8-162-has-caused-mango-es-3-2-2-to-become-unreachable/13 but that didn't seem to do anything either.

      Any help is appreciated.

      Thanks,
      Chad

      1 Reply Last reply Reply Quote 0
      • JoelHaggarJ
        JoelHaggar
        last edited by

        Hi Chad,

        My guess is it is a permissions issue on the port. What port are you running Mango on? You might also want to look at the link installation script as this might make your installation easier. https://docs-v3.mango-os.com/install-script

        1 Reply Last reply Reply Quote 0
        • cmusselmC
          cmusselm
          last edited by

          Thanks, Joel, I'll try that here shortly and let you know!

          We have port 80 specified in our properties file; web.port

          Thanks,
          Chad

          CraigWebC 1 Reply Last reply Reply Quote 0
          • cmusselmC
            cmusselm
            last edited by

            Joel,

            The URL specified for the install script returns a 404 error.

            03cb3494-0905-4abe-9a45-b82b65cdc2e7-image.png

            Is there an updated one to use?

            Thanks,
            Chad

            1 Reply Last reply Reply Quote 0
            • JoelHaggarJ
              JoelHaggar
              last edited by

              Hey Chad, sorry about that URL. This is the correct one.
              https://raw.githubusercontent.com/infiniteautomation/ma-core-public/main/Core/bin/install-mango.sh

              Looks like this has been updated to work with Mango v4 so hopefully still works for Mango v3.

              1 Reply Last reply Reply Quote 0
              • CraigWebC
                CraigWeb @cmusselm
                last edited by

                @cmusselm Mango will not be able to bind to port 80 unless the root user starts it. This is a Linux permissions issue. You will need to use IP tables to route port 80 to port 8080
                You should see an error like this in the ma.log

                ERROR 2021-06-02T21:15:48,714 (com.serotonin.m2m2.Main.main:162) - Error during initialization 
                java.io.IOException: Failed to bind to /0.0.0.0:80
                
                1 Reply Last reply Reply Quote 0
                • cmusselmC
                  cmusselm
                  last edited by

                  Thanks, Joel.

                  I was still getting an error, but found this command on Stack Overflow for a post around port permissions and it did the trick for me.

                  sudo /sbin/sysctl -w net.ipv4.ip_unprivileged_port_start=0
                  

                  Thanks,
                  Chad

                  1 Reply Last reply Reply Quote 0
                  • cmusselmC
                    cmusselm
                    last edited by

                    This post is deleted!
                    1 Reply Last reply Reply Quote 0
                    • JoelHaggarJ
                      JoelHaggar
                      last edited by

                      Excellent, glad you got it working. Basically, you need to allow unprivileged users access to lower ports. By default, Linux does not allow this.

                      1 Reply Last reply Reply Quote 0
                      • First post
                        Last post