bin/164526: kill(1) can not kill process despite on -KILL

Коньков Евгений kes-kes at yandex.ru
Thu Feb 2 09:14:20 UTC 2012


Здравствуйте, Alan.

Вы писали 2 февраля 2012 г., 9:20:10:

AD> The following reply was made to PR bin/164526; it has been noted by GNATS.

AD> From: Alan DeKok <aland at deployingradius.com>
AD> To: =?UTF-8?B?0JrQvtC90YzQutC+0LIg0JXQstCz0LXQvdC40Lk=?=
AD>  <kes-kes at yandex.ru>, 
AD>  FreeRadius users mailing list <freeradius-users at lists.freeradius.org>
AD> Cc: Jilles Tjoelker <jilles at stack.nl>, 
AD>  firebird-devel at lists.sourceforge.net, bug-followup at FreeBSD.org
AD> Subject: Re: bin/164526: kill(1) can not kill process despite on -KILL
AD> Date: Thu, 02 Feb 2012 08:13:54 +0100

AD>  Коньков Евгений wrote:
 >> repeated again:
 >> bug is repeateable:
 >> 1. radiusd + mod_perl + example.pl(it is connects to FireBird) +
AD>  
AD>    Why?  FreeRADIUS has native support for all major SQL servers.
AD>  There's no need to use a Perl plugin.
AD>  
 >> FireBIrd
 >> 2. restart firebird
 >> 3. try to restart radiusd
 >> 4. process in fall into STOP state
AD>  
AD>    You've built a system which has a lot of components.  The problem
AD>  could be anywhere.
AD>  
AD>    I'll note that I've *never* seen this problem when using the native
AD>  SQL plugins which are shipped with FreeRADIUS.
AD>  
AD>    Alan DeKok.

sorry: mod_perl => rlm_perl which configured as:

cat modules/perl
perl {
        module = ${confdir}/example.pl
     }

cat sites/default
......
authorize {
  ...
  mschap
  perl
  }
...
accounting {
        detail
        perl

   }

and in example.pl do:

cat example.pl
# Function to handle accounting
sub accounting {
 my $result;

 doLog( L_INFO, "$dbh_fb: start accounting" );
 $result= RLM_MODULE_OK;

# $RAD_REPLY{'mpd-Update-Interim-Interval'} = '60';
# $RAD_REPLY{'mpd-Drop-User'} = 'Yes';.
 &db_logAttributes("accounting");
 &updateOnline();
 if( changePacket( $RAD_REQUEST{'User-Name'} ) ) {
   $RAD_REPLY{'mpd-drop-user'}= 1;
   }

 doLog( L_INFO, "$dbh_fb: finish accounting" );
 if ($result) {return $result; }...
 return RLM_MODULE_REJECT;
}

......
#------------------------          UPDATE ONLINE
sub updateOnline{
#!my ($sql, $query, $packet);
$_= $RAD_REQUEST{'Acct-Status-Type'};
SWITCH: {
 /Interim-Update|Stop/ && do {
   my $termCause= $RAD_REQUEST{'Acct-Status-Type'} eq 'Stop' ? $RAD_REQUEST{'Acct-Terminate-Cause'} || 'User-Request' : 'OnLine';
   my $trafIn= $RAD_REQUEST{'Acct-Input-Octets'} + 2**32*$RAD_REQUEST{'Acct-Input-Gigawords'};
   my $trafOut= $RAD_REQUEST{'Acct-Output-Octets'} + 2**32*$RAD_REQUEST{'Acct-Output-Gigawords'};


   doLog( L_INFO, "$dbh_fb: update online status for '$RAD_REQUEST{'User-Name'}'" );
   $dbh_fb->do( $QR_UPDATE_ONLINE_STATUS, undef,.
      $RAD_REQUEST{'User-Name'}
      ,$RAD_REQUEST{'Acct-Session-Time'}
      ,$RAD_REQUEST{'NAS-Port'}
      ,$RAD_REQUEST{'Calling-Station-Id'}
      ,$RAD_REQUEST{'NAS-IP-Address'}
      ,$trafIn
      ,$trafOut
      ,$termCause
      ,$RAD_REQUEST{'Framed-IP-Address'}
      ,$RAD_REQUEST{'Acct-Unique-Session-Id'}
      )  or doLog( L_INFO, "DO UPDATE ONLINE FB $DBI::errstr" );
......
 }

I just connect to DB and update session info.

But maybe this may lock system?

sub doLog {
 my( $level, $message )= @_;

 my $datetime= localtime();
 radiusd::radlog( $level, $message );
 `echo "$datetime: $message" >> "/var/log/radius/radius.kes.log"`;
 }

-- 
С уважением,
 Коньков                          mailto:kes-kes at yandex.ru



More information about the freebsd-bugs mailing list