Docker file:

FROM perl:5.24 MAINTAINER Neil Watson <neil@w**.ca> LABEL site="cfbot" LABEL version="1.0" RUN cpanm Config::YAML JSON Bot::BasicBot Cache::FastMmap XML::Feed \ Mojo::UserAgent Mojo::DOM Net::SSLeay # Force this install because of bug: # https://rt.cpan.org/Public/Bug/Display.html?id=118548 RUN cpanm --force POE::Component::SSLify COPY . /var/lib/cfbot # TODO have bot pull this down and keep it up to date RUN cd /usr/src/ \ && git clone https://github.com/cfengine/documentation.git \ && ln -fs /usr/src/documentation /var/lib/cfbot/documentation WORKDIR /var/lib/cfbot CMD [ "perl", "cfbot.pm", "--debug" ]

Tick subroutine:

sub tick { my $self=shift; my %wake_interval; $wake_interval{seconds} = $config->{wake_interval} * 60; my $now = Time::Piece->localtime(); return 60 if ( $now < $hush ); my @events = ( { name => \&cfbot::atom_feed, arg => [{ 'feed' => "$config->{bug_feed}" }] }, { name => \&cfbot::git_feed, arg => [{ 'feed' => $config->{git_feed}, 'owner' => 'cfengine', 'repo' => 'core', }] }, { name => \&cfbot::git_feed, arg => [{ 'feed' => $config->{git_feed}, 'owner' => 'cfengine', 'repo' => 'masterfiles', }] }, { name => \&cfbot::git_feed, arg => [{ 'feed' => $config->{git_feed}, 'owner' => 'neilhwatson', 'repo' => 'evolve_cfengine_freelib', }] }, { name => \&cfbot::git_feed, arg => [{ 'feed' => $config->{git_feed}, 'owner' => 'neilhwatson', 'repo' => 'delta_reporting', }] }, { name => \&cfbot::git_feed, arg => [{ 'feed' => $config->{git_feed}, 'owner' => 'neilhwatson', 'repo' => 'vim_cf3', }] }, { name => \&cfbot::git_feed, arg => [{ 'feed' => $config->{git_feed}, 'owner' => 'neilhwatson', 'repo' => 'cfbot', }] }, { name => \&cfbot::say_words_of_wisdom, arg => [ '' ], }, { name => \&cfbot::index_cfe_functions, arg => [ '' ], }, ); for my $e ( @events ) { $self->forkit({ run => $e->{name}, arguments => $e->{arg}, channel => $config->{irc}{channels}[0], handler => '_fork_notice', }); } return $wake_interval{seconds}; }

Alex / talexb / Toronto

Thanks PJ. We owe you so much. Groklaw -- RIP -- 2003 to 2013.


In reply to Re: Forking not working when perl runs in Docker by talexb
in thread Forking not working when perl runs in Docker by neilwatson

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.