Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Forking not working when perl runs in Docker

by talexb (Chancellor)
on Nov 07, 2016 at 17:03 UTC ( [id://1175447]=note: print w/replies, xml ) Need Help??


in reply to Forking not working when perl runs in Docker

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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1175447]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (2)
As of 2024-04-25 05:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found