Closed zacharyabresch closed 5 years ago
argv[0]
in your example contains string spade/
, try argv[1]
. Also Daemonize.exit
method doesn't stop existing instance, it's internally used and just removes pid file before exit current process.
Ha, I had updated my post. I'm still getting used to Python and totally forgot argv[0]
is the script name. I ended up using some code I found to make my own Daemon class. Thanks!
So, I've tried a few times to get this to work to no avail. Does this work?? Here's the script I'm running ... pretty much based off the example provided. (contents of
spade/__main__.py
)System Details
pipenv
andvenv
(shouldn't matter)I run this like so:
python -u spade/ start
(to stop run the same but replacestart
withstop
)The script runs without error but does nothing. Can't find it in process list. No
pid
file is created. The log file is created but contains nothing. Start & stop seem to do nothing as well. I've scanned my filesystem for results ... nothing. Perhaps I'm missing something but it seems like daemonizing Python scripts is a lost art because all the libraries I've tried just don't seem to work.