This article provides instructions on how to restart the Data360 Analyze server automatically after a reboot in Linux. There are a couple of different options below.
We supply our customers with the start and stop scripts:
launchData3SixtyAnalyze.sh
stopData3SixtyAnalyze.sh
They are located in the <Data360 Install Dir>/bin/ directory.
OPTION 1: Using Crontab
If the analyze user has privileges to use the reboot option in crontab, set "launchData3SixtyAnalyze.sh" in crontab as Analyze user. We recommend that every user has privileges to edit their crontab.
Below are the steps - they need to be run as 'root' user:
1- crontab -e -u {analyze_user}
2- on editor screen add the below line - this will start your Data3Sixty Analyze service after reboot.
@reboot {Analyze_user_home}/Data3SixtyAnalyze/bin/launchData3SixtyAnalyze.sh
OPTION 2: Using rc.local
We can also use the ‘rc.local’ file located in ‘/etc/’ to execute scripts and commands at startup.
You will need to create an entry to execute the script in the file, and the script will be executed on restart
However, permissions to make the file /etc/rc.local executable are needed beforehand:
$ sudo chmod +x /etc/rc.local
Then you'll need to add the script to be executed in the file
$ sudo vi /etc/rc.local
At the end of file, add the following entry
sh /root/script.sh &
Save the file and exit.
OPTION 3: Using / Configuring Systemd
The startup script is located in /etc/systemd/system and can be called whatever you like, for example, Data360Analyze.service. The contents of the file should contain:
[Unit]
Description=Data360 Analyze Service
After=network.target
[Service]
Type=forking
User=analyze
Group=analyze
ExecStart=/opt/Data3SixtyAnalyze/bin/launchData3SixtyAnalyze.sh
ExecStop=/opt/Data3SixtyAnalyze/bin/stopData3SixtyAnalyze.sh
TimeoutStartSec=30
TimeoutStopSec=30
[Install]
WantedBy=multi-user.target
Although the software is not installed by root, you will need root level privileges to create it. Once you create the file, you'll need to run
systemd daemon-reload
Comments
0 comments
Please sign in to leave a comment.