Changeset 439 for bot


Ignore:
Timestamp:
06/25/12 18:38:25 (12 years ago)
Author:
nanardon
Message:
  • add sysinit script
Location:
bot/trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • bot/trunk/MANIFEST

    r397 r439  
    1010sophie-tools.spec.in 
    1111t/Sophie-Bot.t 
     12sysinit/sophie-bot 
  • bot/trunk/bin/sophie-bot

    r433 r439  
    4343    $runas       ||= $config{runas}; 
    4444    $pidfile     ||= $config{pidfile}; 
     45    $type        ||= $config{type}; 
    4546} 
    4647 
     
    8889} 
    8990 
    90 if ($runas) { 
    91     my ($login,$pass,$uid,$gid) = $runas =~ /^\d/ 
    92     ? getpwuid($runas) 
    93     : getpwnam($runas); 
    94  
    95     $> = $uid; $) = $gid; 
    96     if ($> ne $uid) { 
    97         die "Cannot change to user $runas\n"; 
    98     } 
    99 } 
    100  
    10191if ($daemon) { 
    102  
    10392    my $pid = fork(); 
    10493 
     
    121110} 
    122111 
     112if ($runas) { 
     113    my ($login,$pass,$uid,$gid) = $runas =~ /^\d/ 
     114    ? getpwuid($runas) 
     115    : getpwnam($runas); 
     116 
     117    $> = $uid; $) = $gid; 
     118    if ($> ne $uid) { 
     119        die "Cannot change to user $runas\n"; 
     120    } 
     121} 
     122 
    123123$sc->run; 
    124124 
  • bot/trunk/lib/Sophie/Bot.pm

    r433 r439  
    88$RPC::XML::FORCE_STRING_ENCODING = 1; 
    99 
    10 our $VERSION = '0.01'; 
     10our $VERSION = '0.02'; 
    1111 
    1212sub new { 
  • bot/trunk/lib/Sophie/Bot/IRC.pm

    r433 r439  
    6262    $heap->{nopong} ||= 0; 
    6363    if ($heap->{nopong} >= NO_PONG_TOUT) { 
    64         $heap->{irc}->yield( 'connect', { } ); 
     64        $_[KERNEL]->stop; 
    6565        return; 
    6666    } 
     
    9090 
    9191    $_[KERNEL]->stop; 
    92     #die "Nick already in use\n"; 
    9392} 
    9493 
  • bot/trunk/sophie-bot.spec.in

    r405 r439  
    3838%makeinstall_std 
    3939 
     40mkdir -p %buildroot%_sysconfdir/init.d 
     41install -m755 sysinit/sophie-bot %buildroot%_sysconfdir/init.d/sophie-bot 
     42 
    4043%clean 
    4144rm -rf %buildroot 
     
    4447%defattr(-,root,root) 
    4548%doc Changes README 
     49%_sysconfdir/init.d/sophie-bot 
    4650%_bindir/* 
    4751%{_mandir}/*/* 
Note: See TracChangeset for help on using the changeset viewer.