Another utility which is common for automation of services in linux is the systemctl.
...
In order to create XpoLog service via this utility, please follow:
1) install and run XpoLog as root user
2) vi /etc/systemd/system/xpolog.service
3) Set the xpolog.service file contents to:
[Unit]
Description=XpoLog Service
After=network-online.target
[Service]
Type=forking
NotifyAccess=main
User=root
ExecStart=/PATH_TO_XPOLOG_INSTALL_DIR/runXpoLog.sh start
Restart=always
[Install]
WantedBy=multi-user.target
4) Grant execution permission to the service file - chmod +x /etc/systemd/system/xpolog.service
5) Update the OS regarding the new service - systemctl enable xpolog
6) systemctl daemon-reload
- Kill XpoLog (it will automatically start)
- From this point on:
systemctl start xpolog
systemctl stop xpolog
- Change /PATH_TO_XPOLOG_INSTALL_DIR/restart.sh (In order to deal with the daily recycle of XpoLog):
#!/bin/sh
DIR=`dirname $0`
nohup sh $DIR/runXpoLog.sh stop