zopefoundation / zdaemon

Python program that wraps commands to make them behave as proper daemons under Unix / Linux / Mac OS X
Other
21 stars 8 forks source link

How to specify relative paths into configuration file? #2

Open giampaolo opened 10 years ago

giampaolo commented 10 years ago

Hello. I have a configuration file looking like this:

<runner>
    daemon on
    program easymonitor
    socket-name _zdaemon.sock
    transcript myapp.log
</runner>

I would like "socket-name" and "transcript" paths to be relative compared to where the configuration file lives. As zdaemon is right now, in case a relative path is specified, os.getcwd() is assumed. That means that I'm forced to specify an absolute path which of course is valid on my machine but may change somewhere else (production, staging. etc.).

I think there should a way to override this behavior, either by providing some kind of templating systems (e.g. "transcript {{HERE}}/myapp.log") or by assuming os.path.abspath(os.path.dirname(file)) in case of a relative path.

Thoughts?

giampaolo commented 10 years ago

Up?

mgedmin commented 9 years ago

Personally I think it's a good idea.

zdaemon uses ZConfig to read and interpret the config file. I think this bug should be reassigned to ZConfig. Something similar to https://github.com/zopefoundation/ZConfig/pull/2 perhaps, with ${CONFFILEPATH} or better syntax?