Skip to content

Instantly share code, notes, and snippets.

@preaction
Created February 12, 2016 01:49
Show Gist options
  • Save preaction/5ba75f229229daa480fc to your computer and use it in GitHub Desktop.
Save preaction/5ba75f229229daa480fc to your computer and use it in GitHub Desktop.
#!/usr/bin/env perl
# Run a CPAN::Reporter::Smoker under the current Perl
# To start the daemon:
# perl smoker.pl start
# To stop the daemon:
# perl smoker.pl stop
#
# To start the smoker under all Perls in perlbrew:
# perlbrew exec perl smoker.pl start
use strict;
use warnings;
use Daemon::Control;
use Config;
# Uniquely identify this Perl by its version and archname
my $name = join( "-", $^V, $Config{archname} );
exit Daemon::Control->new(
name => "CPAN::Reporter::Smoker",
program => $^X,
program_args => [ '-MCPAN::Reporter::Smoker', '-e', 'start' ],
pid_file => '/tmp/' . $name . '-smoker.pid',
stderr_file => '/tmp/' . $name . '-smoker.err',
stdout_file => '/tmp/' . $name . '-smoker.out',
fork => 2,
)->run;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment