Skip to main content

2.4 – Install as macOS daemon

Run the following commands:

  1. cd /Library
  2. sudo unzip
  3. sudo chown username SparkGateway username should be the login name under which gateway will run
  4. sudo chgrp admin SparkGateway
  5. cd SparkGateway
  6. sudo nano with following content:
    java -jar $SPARK_HOME/SparkGateway.jar -c=$SPARK_HOME/gateway.conf
  7. Save the file and run sudo chmod a+x
  8. Change the default directory and listening port if port 80 is occupied in gateway.conf:
    port = 8080
    logfile = /Library/SparkGateway/logs/gateway.log
    html = /Library/SparkGateway/html
    license = /Library/SparkGateway/license
  9. Use sudo ./ to test if there are any errors within the script.
  10. cd /Library/LaunchDaemons
  11. sudo nano com.toremote.gateway.plist with following content:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN""">
    <plist version="1.0">
  12. Service commands:
  • Load the service: sudo launchctl load /Library/LaunchDaemons/com.toremote.gateway.plist
  • Unload the service: sudo launchctl unload /Library/LaunchDaemons/com.toremote.gateway.plist