How can i tell which conf file it is using

i have this program running on my solaris and there are two identical config files, i am not sure which one is being used by this program but I am sure it uses one of them.

I run lsof -p {pid} but it does not show which config file has been read by this program, what i am doing wrong?

thanks

lsof won't show the config file unless it actually has it open. The daemon probably opens it once, reads it, and closes it again. Check the init scripts for the daemon, they may specify which config file it uses.

Perhaps you can try renaming or moving each temporarily, and running the program, to see if it might create a new one, or errors out. Do programs generally create conf files if they are missing? I know it can happen in Mac OS X.

Try

# truss -aefp -rall -wall {PID of running application}

Then somehow tell your application to re-read it's config file? At least then you can look through the truss output to see the system calls. Might be able to do without the "-wall" (list all writes in full)

You could also use truss to wrap the application, and parse the output:

# truss -af /path/to/executable

Hope this helps

Doing an ls -lu of each conf file will show when they was last acessed, assuming no backups or virus sweeps are running then one conf file will have a recent date and time and the other an older one.