Announcement

Collapse
No announcement yet.

Start up Mirth as non-root Debian Stretch

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

  • Start up Mirth as non-root Debian Stretch

    Please let me know if I'm not understanding this correctly. I'm not a Java developer. I asked this or similar question in the support section of the forum but nobody had anything to say or didn't care.

    /etc/init.d/mirthservice is a link to the startup script that executes a whole bunch of stuff to make Mirth Connect run. Compared to other Java applications there seems to be no "wrapper" where you can define a user or other variables to pass on to the script. Other Java applications have this feature in their start up scripts.

    Here is an example of I think is the beginning of a Java wrapper of what I have seen/read on the internet:

    Code:
    #! /bin/sh
    ### BEGIN INIT INFO
    # FIXME: set Provides and Short-Description
    # Provides:          My java app
    # Required-Start:    $remote_fs $syslog
    # Required-Stop:     $remote_fs $syslog
    # Default-Start:     2 3 4 5
    # Default-Stop:      0 1 6
    # Short-Description: initscript for My java app
    ### END INIT INFO
    
    # FIXME: your name here
    # Author: Leonid Shevtsov <[email protected]>
    
    # Do NOT "set -e"
    
    PATH=/sbin:/usr/sbin:/bin:/usr/bin
    # FIXME: configure your app here
    DESC="My Java app"
    NAME="my-java-app"
    CWD=/home/my-java-app/apps/my-java-app/current
    USER=my-java-app
    GROUP=my-java-app
    JAVA=/usr/bin/java
    JVM_ARGS=
    JAR_PATH=/home/my-java-app/apps/my-java-app/current/target/my-java-app.jar
    JAVA_ARGS="$JVM_ARGS -jar $JAR_PATH"
    PIDFILE=/var/run/$NAME.pid
    SCRIPTNAME=/etc/init.d/$NAME
    .
    .
    .
    How would I go about to modify the operating system to start Mirth Connect as a non root user? Is this something you can solve right in Java? Does it even matter to have Mirth Connect start as non user? People talk so casually about having all your services start as non root if have a server out on the internet/cloud... but how do you implement this for Mirth Connect? Am I crazy for asking this question?

    I hope I'm making sense...
Working...
X