Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^2: How do I shut down a Bot::BasicBot?

by myuserid7 (Scribe)
on Jul 16, 2010 at 08:43 UTC ( #849942=note: print w/replies, xml ) Need Help??


in reply to Re: How do I shut down a Bot::BasicBot?
in thread How do I shut down a Bot::BasicBot?

Still the same problem :/
  • Comment on Re^2: How do I shut down a Bot::BasicBot?

Replies are listed 'Best First'.
Re^3: How do I shut down a Bot::BasicBot?
by bingos (Vicar) on Jul 16, 2010 at 15:52 UTC

    Apologies I missed something whilst looking through Bot::BasicBot's code:

    #!/usr/bin/perl package main; my $bot = Perlbot->new (no_run => 0, server => 'swiftco.dal.net', chan +nels => ['#randomtestingchannel']); $SIG{'INT'} = 'Handler'; $SIG{'TERM'} = 'Handler'; sub Handler { $bot->{_shutdown} = 1; $bot->shutdown('Leaving.'); }; $bot->run; package Perlbot; use strict; use warnings; use POE; use base qw(Bot::BasicBot); sub irc_disconnected_state { my $self = $_[OBJECT]; if ( $self->{_shutdown} ) { $poe_kernel->alarm_remove_all(); $poe_kernel->alias_remove($_) for $poe_kernel->alias_list(); return; } $self->SUPER::irc_disconnected_state( @_ ); } sub irc_error_state { my $self = $_[OBJECT]; if ( $self->{_shutdown} ) { $poe_kernel->alarm_remove_all(); $poe_kernel->alias_remove($_) for $poe_kernel->alias_list(); return; } $self->SUPER::irc_error_state( @_ ); }

    It is icky nasty though.

      After quitting IRC, it says

      ^C (in cleanup) Can't call method "post" on an undefined value at /usr/local/lib/perl5/site_perl/5.10.0/Bot/BasicBot.pm line 1500 during global destruction.

      This was the same error I had after running exit 0 from irc_error_state

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://849942]
help
Chatterbox?
[davido]: then it reads from /etc/passwd to decide who my uid is.
[davido]: sorry, typed that before you asked me to disable proc
[davido]: but you stumped me; don't know how to disable proc.
[tye]: I don't know if you can just dismount, but I thought so.
[davido]: yeah, umount -f isn't powerful enough.
[tye]: probably something in the init subsystem that does the mounting that you could disable and reboot.
davido needs to close laptop to board flight home from yapc.
[davido]: I'll look into it in a few hours probably.
[davido]: when i do get to that point I think I'll do it in a vm snapshot just in case. :)
[oiskuu]: tye, you were right: loginuid/sessionid are part of task struct if compiled with AUDITSYSCALL. I have some doubts if you should actually depend on that feature.

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2017-06-23 20:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (555 votes). Check out past polls.