On 5/22/14 10:28 AM, wo...@4amlunch.net wrote:
On Saturday, April 10, 2010 11:52:41 PM UTC-4, Ben Finney wrote:
pid = daemon.pidlockfile.TimeoutPIDLockFile(
"/tmp/dizazzo-daemontest.pid", 10)
Has pidlockfile been removed? (1.6)
-brian
"Have you released the inertial dampener?
On 05/22/2014 07:31 AM, wo...@4amlunch.net wrote:
I know it's 4 years later, but I'm currently battling this myself. I do exactly
this and yet it doesn't appear to be keeping the filehandler open. Nothing ever
gets written to logs after I daemonize!
You didn't include any context (important a
onize!
Ok, made it work, although I think this goes against the documentation as well
as what's here.
I changed:
context = daemon.DaemonContext(
# Stuff here
)
context.files_preserve[fh.stream]
to:
context = daemon.DaemonContext(
# Stuff here
files_preserve[fh.stream]
)
On Saturday, April 10, 2010 11:52:41 PM UTC-4, Ben Finney wrote:
> pid = daemon.pidlockfile.TimeoutPIDLockFile(
> "/tmp/dizazzo-daemontest.pid", 10)
Has pidlockfile been removed? (1.6)
-brian
--
https://mail.python.org/mailman/listinfo/python-list
I know it's 4 years later, but I'm currently battling this myself. I do exactly
this and yet it doesn't appear to be keeping the filehandler open. Nothing ever
gets written to logs after I daemonize!
--
https://mail.python.org/mailman/listinfo/python-list
Sean DiZazzo writes:
> I'm finally getting around to trying out the python-daemon module and
> have hit a wall. I'm trying to set up logging inside of the "with
> daemon.DaemonContext" block. But when I try to use a logger inside
> the block it throws an error:
Vinay Sajip writes:
> On Apr 9, 12:46 am, Ben Finney wrote:
> > Not quite. As the docs specify, you need to pass the *file
> > descriptors* for the files you want preserved.
>
> Okay, but the docstring you quoted:
>
> "Elements of the list are file descriptors (as returned by a file
> object's `
On Apr 9, 12:46 am, Ben Finney wrote:
> > I think you just have to pass the file object used by the handler
> > (fh.stream) in the files_preserve array.
>
> Not quite. As the docs specify, you need to pass the *file descriptors*
> for the files you want preserved.
Okay, but the docstring you quot
Ben Finney wrote:
Vinay Sajip writes:
On Apr 8, 1:58 pm, Rebelo wrote:
Vinay Sajip wrote:
My guess is - files_preserve needs to be passed a file handle and
not alogginghandler.
This is correct. As the ‘DaemonContext.__init__’ docstring says::
| `files_preserve`
| :Default: ``None
Rebelo writes:
> i found a crude workaround:
> i wrote a function in which i start logging after deamon starts
That seems rather sub-optimal; you'll be unable to use the logger for
anything before the daemon context opens. This kind of problem is
exactly what ‘DaemonContext.files_preserve’ is in
Vinay Sajip writes:
> On Apr 8, 1:58 pm, Rebelo wrote:
> > Vinay Sajip wrote:
> > > My guess is - files_preserve needs to be passed a file handle and
> > > not alogginghandler.
This is correct. As the ‘DaemonContext.__init__’ docstring says::
| `files_preserve`
| :Default: ``None``
|
Vinay Sajip wrote:
On Apr 8, 1:58 pm, Rebelo wrote:
Vinay Sajip wrote:
On Apr 8, 1:28 pm, Rebelo wrote:
when i use this :
context = daemon.DaemonContext(stdin=sys.stdin, stdout=sys.stdout,
files_preserve=[fh], signal_map = {signal.SIGTERM:
'terminate',signal.SIGHUP: 'termi
i found a crude workaround:
i wrote a function in which i start logging after deamon starts
--
http://mail.python.org/mailman/listinfo/python-list
On Apr 8, 1:58 pm, Rebelo wrote:
> Vinay Sajip wrote:
> > On Apr 8, 1:28 pm, Rebelo wrote:
> >> when i use this :
> >> context = daemon.DaemonContext(stdin=sys.stdin, stdout=sys.stdout,
> >> files_preserve=[fh], signal_map = {signal.SIGTERM:
> &
Vinay Sajip wrote:
On Apr 8, 1:28 pm, Rebelo wrote:
when i use this :
context = daemon.DaemonContext(stdin=sys.stdin, stdout=sys.stdout,
files_preserve=[fh], signal_map = {signal.SIGTERM:
'terminate',signal.SIGHUP: 'terminate'})
i don't get error but i still can'
On Apr 8, 1:28 pm, Rebelo wrote:
> when i use this :
> context = daemon.DaemonContext(stdin=sys.stdin, stdout=sys.stdout,
> files_preserve=[fh], signal_map = {signal.SIGTERM:
> 'terminate',signal.SIGHUP: 'terminate'})
>
> i don't get error but i stil
On Apr 8, 1:28 pm, Rebelo wrote:
> when i use this :
> context = daemon.DaemonContext(stdin=sys.stdin, stdout=sys.stdout,
> files_preserve=[fh], signal_map = {signal.SIGTERM:
> 'terminate',signal.SIGHUP: 'terminate'})
>
> i don't get error but i stil
when i use this :
context = daemon.DaemonContext(stdin=sys.stdin, stdout=sys.stdout,
files_preserve=[fh], signal_map = {signal.SIGTERM:
'terminate',signal.SIGHUP: 'terminate'})
i don't get error but i still can't write to log file
what am i doing wrong?
--
i get : IOError: [Errno 9] Bad file descriptor
when i have logging and using daemon.DaemonContext()
i tried passing :
fh = logging.handlers.TimedRotatingFileHandler(LOG_FILENAME, 'midnight',
encoding='utf-8')
with :
context = daemon.DaemonContext()
context.files_preserve=[f
Sean DiZazzo writes:
> On Dec 10, 5:37 pm, Sean DiZazzo wrote:
> > I'm finally getting around to trying out the python-daemon module
> > and have hit a wall. I'm trying to set up logging inside of the
> > "with daemon.DaemonContext" block. But when I
On Dec 10, 5:37 pm, Sean DiZazzo wrote:
> I'm finally getting around to trying out the python-daemon module and
> have hit a wall. I'm trying to set up logging inside of the "with
> daemon.DaemonContext" block. But when I try to use a logger inside
> the block i
I'm finally getting around to trying out the python-daemon module and
have hit a wall. I'm trying to set up logging inside of the "with
daemon.DaemonContext" block. But when I try to use a logger inside
the block it throws an error:
~~
fr
22 matches
Mail list logo