<div dir="ltr">Hi Stephan,<div><br></div><div>Thanks for the answers. Some comments below.<br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Sep 18, 2014 at 6:10 PM, stephan schultchen <span dir="ltr"><<a href="mailto:stephan.schultchen@gmail.com" target="_blank">stephan.schultchen@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra">Hey Ulisses,<br><br></div><div class="gmail_extra">thank you for your feedback, please find my answers inline.<br></div><div class="gmail_extra"><br><div class="gmail_quote"><span class=""><span dir="ltr"></span><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div> 1. why not chroot() and then chdir() to working directory? That would make the default of "/" for the working directory be perfect for the case where only the chroot_directory is set.</div></div></blockquote></span><div><br>i guess that would make the __init__ method a little simpler. but then the working directory has always to be relative to the chroot directory.<br></div><div>Unfortunately the PEP is a little unclear on this topic, but i guess the current implementation will work the way it is.<br><br></div><div>in any case, the default for working directory, in the presence of chroot directory, will be adjusted, so that working_directory is always in under the chroot_directory.<br><br></div><div>or did i miss something?<br></div></div></div></div></blockquote><div><br></div><div>The python-daemon for 2.x series does it differently, check its code. I think it's clearer that way.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class=""><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div> 2. I see not even the PEP mention dealing with pythonpath (sys.path). However, I'd expect that if we're changing the working directory that we add it to sys.path and maybe even remove the old one. A daemon might want to chdir to its private directory where it has more modules that are not installed system-wide. What do you think?</div></div></blockquote><div><br></div></span><div>i think changing sys.path/pythonpath is out of the scope of daemonizing. at least i do not see what a sane default would be for this.<br></div><div><br>In the case that a daemon is changing to its own path, the module loader should always look in the current working directory for modules first. therefore it should not be needed to add the current working directory to sys.path.<br></div></div></div></div></blockquote><div><br></div><div>In my opinion a sane default would be to at least add the new working directory to sys.path. Otherwise importing from current directory won't work after you chdir() and that may be a valid use case for a daemon.</div><div><br></div><div>Thanks,</div><div><br></div><div>-- Ulisses</div></div></div></div></div>