How To Auto-Start INTEGRAL Server At System Startup on Linux
This page describes how to automatically start and stop INTEGRAL Server on Linux (Debian or Ubuntu).
-
Create a simple INTEGRAL Server service script in the /etc/init.d directory. This script will be responsible for starting and stopping INTEGRAL Server.
Assuming pico is your text editor, type the following:
Linux
cd /etc/init.d/
pico integralThen enter your script in the pico editor as shown below:
#!/bin/sh
#
### BEGIN INIT INFO
# Provides: integral
# Required-Start: $remote_fs
# Required-Stop: $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start/Stop INTEGRAL Server daemon
# Description: This service script facilitates startup and shutdown of INTEGRAL Server
### END INIT INFO
case "$1" in
'start')
<integral_extract_dir>/exec/integral-signal-linux start
;;
'stop')
<integral_extract_dir>/exec/integral-signal-linux stop
;;
esac
exit 0
As before, we'll assume that <integral_extract_dir> is the directory where you extracted the INTEGRAL ZIP archive. Remember to replace this string with the actual name of your directory.
Save the script and exit the pico editor.
-
Make sure your script has execute permissions. You will also have to set the ownership of the script as root.
Linux
chmod a+x integral
chown root integral -
Enable the INTEGRAL service script we created in step 1. On Debian or Ubuntu this is done using the update-rc.d command. You can specify which runlevels to start and stop the new service or accept the defaults (defined in our service script). The init.d file will be added to the relevant rc.d startup folders.
Linux
update-rc.d integral defaultsSpecifically, this will create a symbolic link to the INTEGRAL service script in /etc/rc2.d, /etc/rc3.d, /etc/rc4.d and /etc/rc5.d (full multi-user modes) with the following name: S99integral. The letter S means start the service. The two-digit number that follows is used to set the service start order: 01 is used for the highest priority services and 99 for the lowest priority services. Also, this will create a symbolic link to the INTEGRAL service script in /etc/rc0.d (system halt), /etc/rc1.d (single user) and /etc/rc6.d (system reboot) with the following name: K01integral. The letter K means kill the service. The number that follows is used to set the service stop order. Usually the last started service is the first to be stopped and vice-versa.
Once you have performed the above steps, you can reboot your Linux server. This should stop INTEGRAL Server automatically if it's currently running. Once the server reboots, INTEGRAL Server should start automatically.
You will also be able to manually start and stop INTEGRAL Server using the following commands:
Linuxservice integral start
service integral stop
If you ever need to disable the INTEGRAL service script, you can use the update-rc.d command again:
Linuxupdate-rc.d -f integral remove