Find system service by conf file

Setup:The task is to remove all proxy settings. Now I came across a proxy.conf file at /root/http-proxy.conf that contains this (with different IP ):

[Service]
Environment="HTTPS_PROXY="

Question:How can I figure out the corresponding service given the conf file? Assuming there is a service running that uses this conf file.

Notes:Because if there is a service using this file, there might be no need for that service anymore and I would like to remove both the service and the conf file.

1 Answer

I doubt that this file is being used by anything at all. But to confirm this, you can do the following:

  • Looking for other configuration files referencing /root/http-proxy.conf:
grep -Ri "/root/http-proxy.conf" /root/
grep -Ri "/root/http-proxy.conf" /etc/
  • Looking for processes reading this file (probably won't find anything):
lsof | grep "/root/http-proxy.conf"
  • Check if this variable is actually set:
env | grep "10.10.10.10:1234"

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like