You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the service list is retrieved using the systemctl command, and for fetching the running status and pids of a service, ps command is used, but the service name need not to be similar in both systemctl and ps. In that case, the service status is showing as false. Therefore, it is recommended to fetch the status and PIDs directly from the systemctl command to ensure accuracy.
Proposed Solution:
To mitigate this issue, it's suggested to solely rely on systemctl for fetching service statuses and associated PIDs. This ensures consistency and accuracy in reporting service statuses. Below is an updated command to fetch the PID list of a service using systemctl:
mainPid=$(systemctl show -p MainPID --value nginx)
pgrep -P $mainPid
Steps to Reproduce:
Run the current script/command for fetching service statuses and PIDs.
Observe discrepancies in service status reporting due to differing service names between systemctl and ps.
Implement the proposed solution and verify the consistency in service status reporting.
The text was updated successfully, but these errors were encountered:
Description:
Currently, the service list is retrieved using the
systemctl
command, and for fetching the running status and pids of a service,ps
command is used, but the service name need not to be similar in both systemctl and ps. In that case, the service status is showing as false. Therefore, it is recommended to fetch the status and PIDs directly from thesystemctl
command to ensure accuracy.Proposed Solution:
To mitigate this issue, it's suggested to solely rely on
systemctl
for fetching service statuses and associated PIDs. This ensures consistency and accuracy in reporting service statuses. Below is an updated command to fetch the PID list of a service usingsystemctl
:Steps to Reproduce:
The text was updated successfully, but these errors were encountered: