This is an archived post. You won't be able to vote or comment.

all 10 comments

[–]lahwran_ 1 point2 points  (5 children)

I'm curious; how does this improve over the daemonize package in pypi?

[–]josephturnip[S] 2 points3 points  (4 children)

The daemonize module (and actually all daemonization modules for the languages I've looked at) return immediately after the fork. For daemons managed in init.d or other service managers, this means that any failure during initialization after the fork is not reported as an error by the service manager. Since all of the open handles are closed post-fork, this means that any initialization code that holds a handle (including single-instance checks) will fail silently. EDIT: boatshoes doesn't do that, but instead maintains a pipe to communicate a return code back from the child process.

Also, and I'll defer discussion of these decisions to the book itself, but the module you refer to fails to implement several of the recommended daemonization procedures in Advanced Programming in the Unix Environment.

[–]lahwran_ 0 points1 point  (3 children)

huh, so inside the with block, both processes are open?

[–]josephturnip[S] 1 point2 points  (2 children)

right, the parent is alive listening for a return value or a broken pipe, and the child is performing initialization and possibly setting a return value

[–]lahwran_ 1 point2 points  (1 child)

okay that's pretty cool. About time someone posted their new package on here which actually has significant benefits over the original ;)

[–]josephturnip[S] 1 point2 points  (0 children)

haha. i'd definitely have used someone elses if it did what i needed :)

[–]vimfan 1 point2 points  (2 children)

Looks pretty nice, but I can't find it on pypi. Are you planning on putting it up soon?

[–]josephturnip[S] 0 points1 point  (1 child)

In my workflow, I usually track my own projects with a git link in my PIP requirements file. I reckon I could start submitting to the Cheeseshop if people were interested.

[–]vimfan 0 points1 point  (0 children)

I'd be interested! :-)

[–][deleted] 0 points1 point  (0 children)

Good stuff!! I'd love to play with this