Have a new server installed with 25.1.1.25 cloud proxy. The install command was run as root and it completed successfully.
Seeing that the cloud proxy process is running as root. When stopping it using the script (apmservices.cloudproxy.sh), the process ends and the PID file disappears. A moment later, a new PID file is created in the folder but no cloud proxy process is running. If checking the status using the script it says that the process is running. If running the script stop command, it says the process has been stopped and the PID file is removed again.
Almost immediately after a new PID file is created and a new cloud proxy process is running as root. How can we start the cloud proxy using a non-root account and prevent it from starting as root?
There is only 1 instance of the cloud proxy running on this server.
In the "/usr/lib/systemd/system/apmservices-cloudproxy.service" file. needed to change the following lines:
FROM:
[Service]
#User=
TO:
[Service]
User=loadtest
Group=apmagent
Then restart the service.
After that, the service is auto-starting / starting as a non-root account.
Other troubleshooting techniques:
is it possible that when stopping the cloud proxy, actually we are killing the cloud proxy?
stop() {
if [ -f ${PID_PATH} ];then
PID=`cat ${PID_PATH}`;
kill $PID;
rm $PID_PATH;
echo "apmservices.cloudproxy stopped: PID ${PID}";
return 0
else
echo "apmservices.cloudproxy not running";
return 0
fi
}
====
Please collect the below output.
with ./apmservices.cloudproxy.sh stop
i. ls -lart
ii. journalctl -u <cloud proxy service name>
With ./apmservices.cloudproxy.sh start
i. ls -lart
ii. journalctl -u <cloud proxy service name>
Also run the cloud proxy with "set -x" and review the output for both stop and start.