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 Answer 1

1

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

1
  • /proc/<pid>/cwd is a symbolic link to the working directory of the process, /proc/<pid>/cwd is a symbolic link to the corresponding binary, both from the host environment's perspective. Also, lsof +p <pid> shows this path. Jun 4, 2012 at 13:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .