kevinconway / daemons Goto Github PK
View Code? Open in Web Editor NEWPython unix daemon base classes.
License: Apache License 2.0
Python unix daemon base classes.
License: Apache License 2.0
(To be removed)
Hello, I am glad to have found your package after such a long time looking for something simple to run my Django app command inside as a daemon !
I was wondering if there is a way to use daemonizer decorator to stop the process ?
When I killed daemon process "python ShowMe.py" from OS,
I am triyng to start it again
python ShowMe.py start
and getting error
daemon.pid already exist. Cannot start daemon.
but process is dead!
so, I changed in start method
if pid is not None:
message = "Pidfile %s already exist. Cannot start daemon."
to
if pid is not None and psutil.pid_exists(pid):
message = "Pidfile %s already exist. Cannot start daemon."
psutil imported from https://github.com/giampaolo/psutil
On python 3, stopping the daemon raises an AttributeError (the simple daemon example on https://pypi.python.org/pypi/daemons will produce the error).
Traceback (most recent call last):
File "/home/username/mydaemon.py", line 33, in <module>
d.stop()
File "/home/username/.local/lib/python3.5/site-packages/daemons/startstop/simple.py", line 81, in stop
if "an integer is required" in err.message:
AttributeError: 'TypeError' object has no attribute 'message'
This is because Exception
instances in python3 don't have the message
attribute. It should probably be replaced with str(err)
.
I am trying to work with SimulaQron (https://github.com/SoftwareQuTech/SimulaQron) on my Windows. However, when I want to start it (via "simulaqron start") I run into the error "ValueError: invalid signal error". The error seems to result from daemons:
Therefore, I tried the example on https://github.com/kevinconway/daemons and this indeed gave the same error:
Here foo2.py is the second .py file as indicated in the example, so the one with "if __name__
".
It seems to me that the problem is with pidfile. The value for pidfile in d = SleepyDaemon(pidfile=pidfile)
is in my case:
C:\Users\Lynn\Documents\Capstone\testdaemon sleepy.pid
(Here, testdaemon is the directory in which the files of the example are stored.)
I am wondering if someone has an idea what is causing this problem. It would be great to fix this so that I (and others) could work with SimulaQron and daemons via Windows.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.