2

I have a setup with several directories where I can chroot and start the same daemon from. I'd like to be able to tell from which of my multiple directories I started the daemon.

I'd like to find it out by using commands only from outside the chrooted environment, and without having to stop the daemon.

Clarification: When I say "the same daemon" what I mean is that the contents of those directories is identical, the only difference is their path in the host environment.

1 Answers1

1

Would accessing /proc/<pidnumberofyourdaemon>/ help you? There entries such as cmdline, exe and fdinfo/* should give you a hint. Or, just use lsof :)

Janne Pikkarainen
  • 31,852
  • 4
  • 58
  • 81
  • `/proc//cwd` is a symbolic link to the working directory of the process, `/proc//cwd` is a symbolic link to the corresponding binary, both from the host environment's perspective. Also, `lsof +p ` shows this path. – Jacobo de Vera Jun 04 '12 at 13:50