Hans Mulder han...@xs4all.nl writes:
On 24/12/12 01:50:24, Olive wrote:
My goal is to write a script that 1) write something to stdout; then
fork into the background, closing the stdout (and stderr, stdin) pipe.
I have found this answer (forking - setsid - forking)
On Wednesday 02 September 2009 05:57:02 Shan wrote:
I have XML RPC Server listening on a port. This XML RPC Server works
fine when i run it as foreground process. All the clients are able to
connect with the XML RPC Server. But when i run it as daemon(not using
. I am doing it in python way
En Wed, 02 Sep 2009 00:57:02 -0300, Shan m.shanmugara...@gmail.com
escribió:
I have XML RPC Server listening on a port. This XML RPC Server works
fine when i run it as foreground process. All the clients are able to
connect with the XML RPC Server. But when i run it as daemon(not using
. I am
I have XML RPC Server listening on a port. This XML RPC Server works
fine when i run it as foreground process. All the clients are able to
connect with the XML RPC Server. But when i run it as daemon(not using
. I am doing it in python way only), then no clients are able to
connect with the
than making the *current program* become a daemon
process. It implies nothing special about external interaction with
that process; having a service channel for controlling a separate
process isn't part of becoming a daemon.
And now I know of python-daemon, python-ll-core (has a daemon
module
application and could not find anything quite like it.
Note that, as described in PEP 3143, “daemonize a program” means
nothing more than making the *current program* become a daemon
process. It implies nothing special about external interaction with
that process; having a service channel
(replying in ‘comp.lang.python’ for wider feedback on this issue)
On 26-Mar-2009, Francis Irving wrote:
On Thu, Mar 26, 2009 at 12:51:06AM +1100, Ben Finney wrote:
The ‘python-daemon’ distribution includes a module,
‘daemon.pidlockfile’. The ‘daemon.pidlockfile.PIDLockFile’ class is
Ben Finney ben+pyt...@benfinney.id.au writes:
I've submitted PEP 3143
URL:http://www.python.org/dev/peps/pep-3143/ to meet this need,
and have re-worked an existing library into a new ‘python-daemon’
URL:http://pypi.python.org/pypi/python-daemon/ library, the
reference implementation.
Now
as easily done
*after* the program achieves a daemon process?
That depends.
If you mean that one can ignore the uid and gid setting features of the
proposed library so that they are not changed during daemonization and
then make the appropriate calls from the application afterwards, then
yes
On Mar 21, 11:06 pm, Ben Finney ben+pyt...@benfinney.id.au wrote:
Floris Bruynooghe floris.bruynoo...@gmail.com writes:
Had a quick look at the PEP and it looks very nice IMHO.
Thank you. I hope you can try the implementation and report feedback
on that too.
One of the things that might
complex.
Isn't setting the EUID and EGID something that is just as easily
done *after* the program achieves a daemon process?
That depends.
If you mean that one can ignore the uid and gid setting features of the
proposed library so that they are not changed during daemonization
out user shells.
That sounds rather more specific than is needed for the generic
library being proposed here. I'm wary of adding features to an API
that is already quite complex.
Isn't setting the EUID and EGID something that is just as easily done
*after* the program achieves a daemon process
Floris Bruynooghe floris.bruynoo...@gmail.com writes:
Had a quick look at the PEP and it looks very nice IMHO.
Thank you. I hope you can try the implementation and report feedback
on that too.
One of the things that might be interesting is keeping file
descriptors from the logging module
Jean-Paul Calderone exar...@divmod.com writes:
The biggest shortcoming seems to be a complete lack of unit tests.
A full unit test suite is in the source distribution's ‘tests/’
directory. You can run it with ‘python ./setup.py test’.
A quick skim of the code suggests that part of it don't
On Sun, 22 Mar 2009 10:19:58 +1100, Ben Finney ben+pyt...@benfinney.id.au
wrote:
Jean-Paul Calderone exar...@divmod.com writes:
The biggest shortcoming seems to be a complete lack of unit tests.
A full unit test suite is in the source distribution's ‘tests/’
directory. You can run it with
and
specification.
One point to note: This is only intended to address the task of a
program transforming *itself* into a daemon process. If you want to
spawn off *extra* processes and manage them through a “service”
channel, you want something this spec was never meant to cover. You
may be interested
I need wider testing and scrutiny of the implementation and
specification.
PEP: 3143
Title: Standard daemon process library
Version: $Revision: 1.1 $
Last-Modified: $Date: 2009-03-19 12:51 $
Author:Ben Finney ben+pyt...@benfinney.id.au
Status
On Fri, 20 Mar 2009 20:58:58 +1100, Ben Finney ben+pyt...@benfinney.id.au
wrote:
Ben Finney b...@benfinney.id.au writes:
Writing a Python program to become a Unix daemon is relatively
well-documented: there's a recipe for detaching the process and
running in its own process group. However,
On Fri, 20 Mar 2009 21:47:00 +1100, Ben Finney
bignose+hates-s...@benfinney.id.au wrote:
[snip]
Somewhat by accident I noticed this other part of the PEP:
Other Python daemon implementations that differ from this PEP:
[snip]
* Twisted [twisted]_ includes, perhaps unsurprisingly, an
On Mar 20, 9:58 am, Ben Finney ben+pyt...@benfinney.id.au wrote:
Ben Finney b...@benfinney.id.au writes:
Writing a Python program to become a Unix daemon is relatively
well-documented: there's a recipe for detaching the process and
running in its own process group. However, there's much
hi,
i created a daemon process using the following code
import os
import sys
# Default daemon parameters.
# File mode creation mask of the daemon.
UMASK = 0
# Default working directory for the daemon.
WORKDIR = /
# Default maximum for the number of available file descriptors.
MAXFD
In message [EMAIL PROTECTED], paul
wrote:
Before I had posted this question first thing I did was to look at /
dev/ttyS0, and indeed the group is dialout (gid=20)...
What are the full protections on the serial port? That is, can you post the
output of
ls -l /dev/ttyS0
please?
--
I am writing a daemon process that reads data from the serial port /
dev/ttyS0. I am using pyserial the method for setting up a daemon
described in Chris' Python Page (http://homepage.hispeed.ch/py430/
python/) on an Ubuntu linux pc.
Everything works great EXCEPT...
in the daemon script
paul wrote:
If I put these back in and try to run the daemon, the script fails
when I try to connect to the serial port, with this error:
serial.serialutil.SerialException: Could not open port: [Errno 13]
Permission denied: '/dev/ttyS0'
Did you check the permissions on this file? Often you
On Aug 26, 5:20 pm, Bjoern Schliessmann usenet-
[EMAIL PROTECTED] wrote:
paul wrote:
If I put these back in and try to run the daemon, the script fails
when I try to connect to the serial port, with this error:
serial.serialutil.SerialException: Could not open port: [Errno 13]
Permission
Ben Finney [EMAIL PROTECTED] writes:
Hmm. I typed the example program in as a simplified version of what
I'm doing; but didn't actually *run* it. When I do run it, I get no
exception, as you say.
Now I'll have to find out what significant difference there is
between my failing code and this
On Mar 22, 11:19 pm, Ben Finney [EMAIL PROTECTED] wrote:
Howdy all,
For making a Python program calve off an independent daemon process of
itself, I found Carl J. Schroeder's recipe in the ASPN Python Cookbook.
URL:http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/278731
Leo Kislov [EMAIL PROTECTED] writes:
On Mar 22, 11:19 pm, Ben Finney [EMAIL PROTECTED] wrote:
The problem I'm having is that 'os.setsid()' fails with 'OSError:
[Errno 1] Operation not permitted' unless I run the program as the
root user. This isn't a program that I want necessarily running
Howdy all,
For making a Python program calve off an independent daemon process of
itself, I found Carl J. Schroeder's recipe in the ASPN Python Cookbook.
URL:http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/278731
This is a thorough approach, and I'm cribbing a simpler process from
Eirikur Hallgrimsson [EMAIL PROTECTED] wrote:
def daemonize():
if (not os.fork()):
# get our own session and fixup std[in,out,err]
os.setsid()
sys.stdin.close()
sys.stdout = NullDevice()
sys.stderr = NullDevice()
That doesn't close the
On Fri, 23 Feb 2007 08:30:07 -0600, Nick Craig-Wood [EMAIL PROTECTED] wrote:
Eirikur Hallgrimsson [EMAIL PROTECTED] wrote:
[snip]
if (not os.fork()):
# hang around till adopted by init
ppid = os.getppid()
while (ppid != 1):
I didn't actually write this module. I believe I found it in a
discussion in ASPN at Active State.
Thanks for the input, and when I get a chance I will try these alternate
approaches. This module has been working fine for me as is--so far.
Eirikur
--
Thanks all,
I understood there is no shortcut function like BSD daemon(). I'll do
it manually using examples from cookbook...
On 2月22日, 午前1:41, Benjamin Niemann [EMAIL PROTECTED] wrote:
Hello,
Sakagami Hiroki wrote:
What is the easiest way to create a daemon process in Python? Google
On 2007-02-22, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
I understood there is no shortcut function like BSD daemon(). I'll do
it manually using examples from cookbook...
Sure would be nice if somebody posted one. ;)
--
Grant Edwards grante Yow! Oh, I get
Benjamin Niemann wrote:
What is the easiest way to create a daemon process in Python? Google
says I should call fork() and other system calls manually, but is
there no os.daemon() and the like?
You could try
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/278731
Also, more
Hi,
What is the easiest way to create a daemon process in Python? Google
says I should call fork() and other system calls manually, but is
there no os.daemon() and the like?
Regards,
--
Sakagami Hiroki
--
http://mail.python.org/mailman/listinfo/python-list
Hello,
Sakagami Hiroki wrote:
What is the easiest way to create a daemon process in Python? Google
says I should call fork() and other system calls manually, but is
there no os.daemon() and the like?
You could try
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/278731
HTH
Sakagami Hiroki wrote:
Hi,
What is the easiest way to create a daemon process in Python?
I find that this works great. I just pasted my copy, I think you can
find it via Google.
Eirikur
# Daemon Module - basic facilities for becoming a daemon process
# By Coy Krill
# Combines ideas from
On Feb 21, 9:33 am, Eirikur Hallgrimsson [EMAIL PROTECTED]
wrote:
Sakagami Hiroki wrote:
What is the easiest way to create a daemon process in Python?
I've found it even easier to use the built in threading modules:
import time
t1 = time.time()
print t_poc.py called at, t1
import threading
[EMAIL PROTECTED] wrote:
On Feb 21, 9:33 am, Eirikur Hallgrimsson [EMAIL PROTECTED]
wrote:
Sakagami Hiroki wrote:
What is the easiest way to create a daemon process in Python?
I've found it even easier to use the built in threading modules:
import time
t1 = time.time()
print
On Feb 21, 3:34 pm, Benjamin Niemann [EMAIL PROTECTED] wrote:
That's not a daemon process (which are used to execute 'background services'
in UNIX environments).
I had not tested this by running the script directly, and in writing a
response, I found out that the entire interpreter closed when
, but in java, you could make a process a
daemon process, and it would only run as long as the real processes ran. I
think this is a better way to stop gnuchess, as you are 100% sure, that
it'll stop.
Can you do this with popen?
--
Thomas
--
http://mail.python.org/mailman/listinfo/python-list
2006/8/26, Thomas Dybdahl Ahle [EMAIL PROTECTED]:
Hi, I'm writing a program, using popen4(gnuchess),
The problem is, that gnuchess keeps running after program exit.
I know about the atexit module, but in java, you could make a process a
daemon process, and it would only run as long
Hi, I'm writing a program, using popen4(gnuchess),
The problem is, that gnuchess keeps running after program exit.
I know about the atexit module, but in java, you could make a process a
daemon process, and it would only run as long as the real processes ran. I
think this is a better way to stop
a
daemon process, and it would only run as long as the real processes ran. I
think this is a better way to stop gnuchess, as you are 100% sure, that
it'll stop.
Can you do this with popen?
--
Thomas
--
http://mail.python.org/mailman/listinfo/python-list
45 matches
Mail list logo