Unable to start PATROL Agent(PA) automatically after server a reboot on RedHat 7 using systemd.
|
The RedHat 7 handles the scripts differently after a reboot, so PatrolAgent.service has to be created.
[Unit]
Description=BMC Patrol Agent
After=network.target syslog.target local-fs.target centrifydc.service
[Service]
Type=forking
User=ssTruesightSvc
ExecStart=/appsHome/bmc/Patrol3/scripts.d/S50PatrolAgent.sh start
ExecStop=/appsHome/bmc/Patrol3/scripts.d/S50PatrolAgent.sh stop
ExecReload=/appsHome/bmc/Patrol3/scripts.d/S50PatrolAgent.sh stop;/ appsHome/bmc/Patrol3/scripts.d/S50PatrolAgent.sh start
KillMode=/appsHome/bmc/Patrol3/scripts.d/S50PatrolAgent.sh stop
Restart=no
[Install]
WantedBy=multi-user.target
2.After the script is created enter the below command chmod +x PatrolAgent.service 3.Copy the PatrolAgent.service script from the /tmp directory to the /etc/systemd/sytem directory 4.Reload the systemd process to consider newly created PatrolAgent.service OR every time when PatrolAgent.service gets modified. Enter the below command: systemctl daemon-reload 5.Enable this service to start after reboot automatically. systemctl enable PatrolAgent.service 6.If the PATROL Agent is running then kill the process and restart the service by entering the below command: systemctl start PatrolAgent.service |