To execute vREST Enterprise server as service, please follow the steps below:
Create a file named vrest.service with the following content
[Unit] Description=vREST [Service] ExecStart=</path/to/vrest/binary/file> Restart=always User=<USER_NAME> Group=<GROUP_NAME> Environment=PATH=/usr/bin:/usr/local/bin WorkingDirectory=</path/to/vrest/binary/directory> [Install] WantedBy=multi-user.target
In the above file, replace the following paths:
</path/to/vrest/binary/file>
Replace it with absolute path of vREST enterprise binary file. Please change the file name from vrest_linux_x_x_x to vrest_linux, so that you don't have to change the service whenever you want to upgrade / downgrade vREST Enterprise server.
<USER_NAME>
Replace it with the user, by which you want to execute vREST Enterprise server.
<GROUP_NAME>
Replace it with the group name.
</path/to/vrest/binary/directory>
Replace it with absolute path of the directory where vREST enterprise binary file resides. vREST's config.json file should also exist in this directory.
Now execute the following commands:
// Copy your service file into the /etc/systemd/system $ mv vrest.service /etc/systemd/system // Tell systemd about the new service with $ systemctl daemon-reload // Start vrest service $ systemctl start vrest // Enable vrest service to run on boot $ systemctl enable vrest //See logs with $ journalctl -u vrest
- That's it.