Skip Menu |

This queue is for tickets about the Script-Daemonizer CPAN distribution.

Report information
The Basics
Id: 82864
Status: open
Priority: 0/
Queue: Script-Daemonizer

People
Owner: KROMG [...] cpan.org
Requestors: mst [...] shadowcat.co.uk
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: No explanation why you'd use this over Daemon::Control
Date: Mon, 21 Jan 2013 17:45:06 +0000
To: bugs-Script-Daemonizer [...] rt.cpan.org
From: Matt S Trout <mst [...] shadowcat.co.uk>
I can't see anything this does over Daemon::Control - which you could use to daemonize an existing script by passing the main() function to the 'program' argument. (also "code taken from Proc::Daemon" is scary since that's fairly crappy code - if it's just the interface you're aiming for, I'd build it on top of Daemon::Control) -- Matt S Trout - Shadowcat Systems - Perl consulting with a commit bit and a clue http://shadowcat.co.uk/blog/matt-s-trout/ http://twitter.com/shadowcat_mst/ Email me now on mst (at) shadowcat.co.uk and let's chat about how our Catalyst commercial support, training and consultancy packages could help your team.
On Mon Jan 21 12:45:19 2013, mst@shadowcat.co.uk wrote: Show quoted text
> I can't see anything this does over Daemon::Control -
well, there are at least a couple of things Show quoted text
> which you could > use to daemonize an existing script by passing the main() function to > the 'program' argument.
This can be done if you already have a main(). Otherwise Daemon::Control just launches you script (another file) in background, unless I missed something. Show quoted text
> > (also "code taken from Proc::Daemon" is scary since that's fairly > crappy code
I'll be happy to improve it. Suggestions? Show quoted text
> - if it's just the interface you're aiming for, I'd build it on top of > Daemon::Control) >
Are you suggesting I should remove Script::Daemonizer from CPAN?
Subject: Re: [rt.cpan.org #82864] No explanation why you'd use this over Daemon::Control
Date: Tue, 22 Jan 2013 17:12:55 +0000
To: Giacomo Montagner via RT <bug-Script-Daemonizer [...] rt.cpan.org>
From: Matt S Trout <mst [...] shadowcat.co.uk>
On Tue, Jan 22, 2013 at 02:39:22AM -0500, Giacomo Montagner via RT wrote: Show quoted text
> > > > (also "code taken from Proc::Daemon" is scary since that's fairly > > crappy code
> > I'll be happy to improve it. Suggestions? >
> > - if it's just the interface you're aiming for, I'd build it on top of > > Daemon::Control) > >
> > Are you suggesting I should remove Script::Daemonizer from CPAN?
More that it would be nice if Script::Daemonizer was a Daemon::Control wrapper so that you could share the (rather better than Proc::Daemon) logic inside it. -- Matt S Trout - Shadowcat Systems - Perl consulting with a commit bit and a clue http://shadowcat.co.uk/blog/matt-s-trout/ http://twitter.com/shadowcat_mst/ Email me now on mst (at) shadowcat.co.uk and let's chat about how our Catalyst commercial support, training and consultancy packages could help your team.
On Tue Jan 22 12:13:11 2013, mst@shadowcat.co.uk wrote: Show quoted text
> > More that it would be nice if Script::Daemonizer was a Daemon::Control > wrapper so that you could share the (rather better than Proc::Daemon) > logic inside it. >
From 0.93 the code in Script::Daemonizer is much similar to that in Daemon::Control. To answer your question, these are the differences between S::D and D::C: - S::D has the ability to lock pidfile and has a restart() method that keeps it opened and locked across the restart (exec()) phase (unless flock() is implemented on top of fcntl(2) locking, as stated Perl's flock doc). - D::C requires either a program name or a coderef to execute, S::D is meant to daemonize the program that uses it, then allow further code after the call to daemonize(). - S::D has (configurable) defaults that allow daemonization using a single line of code. I'm working on the integration with Daemon::Control.