Skip to content

Installing as a systemd service

James Kerr edited this page Dec 8, 2018 · 2 revisions

If you want to run Koop and the MarkLogic Koop provider as a Linux systemd process so it stays running on your server, use the following instructions. The instructions assume that you have Node.js installed on the system and in the path.

Configure the process

Use sudo to create /etc/systemd/system/ml-esri.service and add the following to the file

[Unit]
Description=MarkLogic Esri Connector
[Service]
ExecStart=<path to install directory>/koop-provider-marklogic/build/koop/server.js
Restart=always

# You need to run as root if you want to run the service on ports 80 and 443
# Use a different user and group if not
User=root
Group=root 

Environment=PATH=/usr/bin:/usr/local/bin
Environment=NODE_ENV=production
WorkingDirectory=<path to install directory>/koop-provider-marklogic/build/koop
[Install]
WantedBy=multi-user.target

Enable the process to run on boot

sudo systemctl enable ml-esri

Start the process

sudo systemctl start ml-esri

Stop the process

sudo systemctl stop ml-esri

Tail the node output log

sudo journalctl -u ml-esri -f