new PEP 3143 Implementation

Ulisses Furquim ulissesf at gmail.com
Thu Sep 18 22:36:28 UTC 2014


Hi Stephan,

Thanks for the answers. Some comments below.

On Thu, Sep 18, 2014 at 6:10 PM, stephan schultchen <
stephan.schultchen at gmail.com> wrote:

> Hey Ulisses,
>
> thank you for your feedback, please find my answers inline.
>
>  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.
>>
>
> 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.
> Unfortunately the PEP is a little unclear on this topic, but i guess the
> current implementation will work the way it is.
>
> 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.
>
> or did i miss something?
>

The python-daemon for 2.x series does it differently, check its code. I
think it's clearer that way.


>
>
>>  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?
>>
>
> 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.
>
> 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.
>

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.

Thanks,

-- Ulisses
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/python-daemon-devel/attachments/20140918/d5ea508e/attachment.html>


More information about the python-daemon-devel mailing list