Creating init script to run adaptor at startup
To run a connector every time its server is booted you need to create a custom init file.
The init file can be organized differently depending on the distribution used and the init systems the distribution adopts.
This can still be found in old systems but the new distribution will use one of the two systems described below.
Create a new configuration file in /etc/init/ with a name like adaptor.conf and copy the following code inside. Modify the directory according to your system.
# Example Adaptor - run adaptor as a daemon
# Adaptor for Sharepoint/fileserver/AD/... that sends feeds to a GSA
description "runs adaptor at start time"
start on runlevel 
stop on runlevel [!2345]
$JAVADIR/bin/java -Djava.util.logging.config.file=logging.properties -jar adaptor-sharepoint-4.1.0-withlib.jar
You can check if the script has any sort of syntax error using the command:
and then start the script using:
sudo start adaptor
Create a new file in the directory:
and copy the following code to /etc/systemd/system/ (changing the directory according to your system, /etc/init.d/rc)
Description=Run adaptor at start time
ExecStart=/bin/sh -c "cd /dir/with/adaptor/files && /dir/with/java/binary/java -Djava.util.logging.config.file=logging.properties -jar adaptor-sharepoint-4.1.0-withlib.jar
In the console, run the following commands:
sudo systemctl daemon-reload
sudo systemctl start adaptor.service
The first command lets the system know that a new service is available. The second command starts the service.