Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multiple daemon instances #23

Open
GeneralDisarray opened this issue Aug 31, 2011 · 3 comments
Open

multiple daemon instances #23

GeneralDisarray opened this issue Aug 31, 2011 · 3 comments

Comments

@GeneralDisarray
Copy link

Stumbled upon this project, looks cool. Definitlely need stuff like this to work around untrustworthy CAs. Was browsing the source, wondering what's the current purpose of the writePid function in convergence-notary.py? Typically you first lock the pid file (via POSIX voluntary File Locking API or something), then write the pid (for debug, if you care about it), then unlock only when the program exits. That way, whenever a user tries to spawn the daemon a second time, or even run in foreground, an exception will be raised upon the lock attempt and the duplicate instance can exit gracefully. Also, this should all happen earlier, before binding ports and such.

Unless you want to allow multiple instances? To present different notary "faces" to the world from the same host? I can't think of a good use case for that, unless you want to obfuscate your relationship as a notary for user X from user Y. In that case you would maybe rename the .pid file to convergence-cert-fingerprint.pid or something.

Sorry to sound like the peanut gallery, I'm not a python guy. Maybe I'll learn some syntax and submit a patch.

@BioMike
Copy link

BioMike commented Aug 31, 2011

There is also a python daemon class that handles this as well: http://pypi.python.org/pypi/python-daemon/

Why was the current implementation chosen and not a completely worked out class?

@moxie0
Copy link
Owner

moxie0 commented Sep 4, 2011

No reason, the PID was thrown in there so that init scripts would have something to work with. Hook me up with a pull request for some cleaner code, and we'll go with that.

@ewanm89
Copy link

ewanm89 commented Sep 4, 2011

Could put the pid stuff only in the init scripts (not too uncommon). Other than that, this is standard practice of how init scripts handle it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants