Automatically Starting DFTS on Boot with systemd
If you install DFTS on RHEL or CentOS Version 7 (or above), you can use systemd to automatically start DFTS on system boot.
Follow these steps:
Log into the system as a privileged user by issuing the following command to become root:
su -
On the DFTS Send side, issue the following command to create and open the dfts.timer file:
vim /etc/systemd/system/dfts-send.timer
Type i to switch to insert move in vim.
On the DFTS Send side, add the following text to the dfts-send.timer file:
|
[Unit]
Description=DFTS Blue System Startup Pause
[Timer]
OnBootSec=120
[Install]
WantedBy=timers.target
|
Issue the following command to set the permissions of the file:
chmod 664 /etc/systemd/system/dfts-send.timer
Note: The dfts.timer file adds a 120 second delay before the service starts up exclusively during the boot up of the Operating System. This allows time for DFTS Receive to start before DFTS Send begins sending data.
Issue the following command to create and open the dfts-send.service file:
vim /etc/systemd/system/dfts-send.service
Type i to switch to insert mode in vim.
On the DFTS Send side, add the following text to the dfts-send.service file:
|
[Unit]
Description=DFTS Send systemd service
After=network.target
[Service]
Type=oneshot
ExecStart=/Owl/dfts/send-blue/startDftsSend start
RemainAfterExit=true
ExecStop=/Owl/dfts/send-blue/startDftsSend stop
[Install]
WantedBy=multi-user.target
|
Issue the following command to set the permissions of the file:
chmod 664 /etc/systemd/system/dfts-send.service
Issue the following commands to reload and enable the service:
systemctl daemon-reload
systemctl enable dfts-timer
Note: On the Send side, the dfts-send.timer controls the automatic startup of the dfts-send service. You do NOT need to enable the dfts-send.service service.
On the DFTS Receive side server, issue the following command to create and open the dfts-receive.service file:
vim /etc/systemd/system/dfts-receive.service
On the DFTS Receive side, add the following text to the file:
|
[Unit]
Description=DFTS Receive systemd service
After=network.target
[Service]
Type=oneshot
ExecStart=/Owl/dfts/recv-red/startDftsReceive start
RemainAfterExit=true
ExecStop=/Owl/dfts/recv-red/startDftsReceive stop
[Install]
WantedBy=multi-user.target
|
Press Esc and type the following command to save the file and exit vim:
:wq
Issue the following command to set the permissions of the file:
chmod 664 /etc/systemd/system/dfts-receive.service
Issue the following commands to reload and enable the service:
systemctl daemon-reload
systemctl enable dfts-receive
Note: There is no start delay timer on the Receive server, so it is necessary to enable the Receive side service for automatic startup.
Reboot the system(s). systemd will start DFTS on boot.