Announcement

Collapse

Mirth Connect 3.12.0 Released!

Mirth Connect 3.12.0 is now available as an appliance update and on our GitHub page. This release includes database performance improvements, improves visual HL7 representation, message pruning, keystore handling, PDF generation, community contributions, and fixes several security vulnerabilities. This release also contains many improvements to commercial extensions. See the release notes for the list of fixes and updates.

Download | See What's New | Upgrade Guide | Release Notes

For discussion on this release, see this thread.
See more
See less

Run Mirth service manually works, running from systemd errs with "No suitable JVM..."

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    mcserver runs in the foreground and is stopped by sending it a TERM or INT (Ctrl-C) signal, so it should be set to simple instead of forking.

    mcservice start forks a process which runs in the background and requires another command to stop the background service.

    You run one or the other. The official docker container runs mcserver.

    Comment


    • #17
      ppazos what I posted works with standard standard systemctl/service commands. Try it, you will see mirth start and stop cleanly.
      Diridium Technologies, Inc.
      https://diridium.com

      Comment


      • #18
        This loop really helped and finally, below Worked!! Note, Java path should be at main folder and not bin folder

        $ cat /usr/lib/systemd/system/mirthconnect.service
        [Unit]
        Description=MirthConnect
        After=network.target

        [Service]
        Type=forking

        User=root
        Group=root

        Environment=INSTALL4J_JAVA_HOME=/app1/java/adoptopenjdk-jre

        ExecStart=/opt/mirthconnect/mcservice start
        ExecStop=/opt/mirthconnect/mcservice stop

        TimeoutSec=60

        [Install]
        WantedBy=multi-user.target
        Last edited by balaji1503; 07-30-2021, 09:30 AM.

        Comment


        • #19
          Thanks balaji1503 I heavily suspect the issue was just about the quotes in the Environment that I was using:

          Environment="INSTALL4J_JAVA_HOME=/root/.sdkman/candidates/java/11.0.10-open"

          I removed them, and left with something very similar to what you have (I wanted to use mcservice not mcserver) and finally it worked!

          So, for the record, this is the right way of specifying the Environment:

          Environment=INSTALL4J_JAVA_HOME=/root/.sdkman/candidates/java/11.0.10-open

          Comment


          • #20
            Thanks balaji1503 and ppazos for the clarification.

            I edited my previous comment to remove the quotes. I had just copied that syntax from the accepted SO answer that I linked.

            Comment


            • #21
              I can also confirm my current configuration works as a service: when the server is rebooted, the mirth service is started automatically

              /usr/lib/systemd/system$ cat mirth.service
              [Unit]
              Description=MirthConnect
              After=network.target

              [Service]
              Type=forking
              RemainAfterExit=yes
              Environment=INSTALL4J_JAVA_HOME=/root/.sdkman/candidates/java/11.0.10-open
              User=root
              Group=root
              ExecStart=/opt/mirth/mcservice start
              ExecStop=/opt/mirth/mcservice stop
              TimeoutSec=60

              [Install]
              WantedBy=multi-user.target

              Comment


              • #22
                According to https://stackoverflow.com/questions/...rked-downsides and the link from the accepted answer https://www.freedesktop.org/software...an/daemon.html, you should prefer setting the type to simple instead of forking and call mcserver instead of mcservice. As I previously mentioned, this is the way NextGen chose to run the official docker container as well.

                Comment

                Working...
                X