Assuming I have my license server installed here: /opt/jetbrains-license-server, how do I configure it to start automatically?
Assuming I have my license server installed here: /opt/jetbrains-license-server, how do I configure it to start automatically?
jochem's answer is more thorough and correct, please reference it.
First, create a jetbrains user on your server.
Second, assuming you choose to use init.d (System V), do the following:
Now place the following contents in this file:
The anwer of @chris-betti is correct. However for DEBIAN based systems I have three additions:
ad 1: see the script file below. You need to change the line
# Default Start
to read:ad 2: Ensure that you have a 'jetbrains' system user that can start the service (and has permission to write in the directory where you installed the licenseserver
ad 3: Regarding the PID file, you need to change the line with
# pidfile:
to:Install the daemon:
There is one more addition to install the service into the various runlevels for debian based systems (Debian, Ubuntu). This will ensure that the service starts at boot and halts on halt.
The script with all the changes
Here is the script with all the changes incorporated.
Both answers are correct though they fail in one respect,
If you are using the script for an Infrastructure as Code framework (e.g. Ansible/Puppet) which uses the status return code to determine what action to take, the script as provided, which always returns 0, will not successfully start up the application automatically when the app is stopped.
My addition to the script is to capture the return code for each of the delegated calls and use this as the exit code and the bottom:
You could expand this to provide useful messages to the user based on the return code but I have not bothered to go that far.