Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 2 Feb 2012 11:13:56 +0200
From:      =?windows-1251?B?yu7t/Oru4iDF4uPl7ejp?= <kes-kes@yandex.ru>
To:        Alan DeKok <aland@deployingradius.com>
Cc:        freebsd-bugs@FreeBSD.org
Subject:   Re[2]: bin/164526: kill(1) can not kill process despite on -KILL
Message-ID:  <1043575287.20120202111356@yandex.ru>
In-Reply-To: <201202020720.q127KAFw055396@freefall.freebsd.org>
References:  <201202020720.q127KAFw055396@freefall.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Çäðàâñòâóéòå, 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@deployingradius.com>
AD> To: =?UTF-8?B?0JrQvtC90YzQutC+0LIg0JXQstCz0LXQvdC40Lk=?=
AD>  <kes-kes@yandex.ru>, 
AD>  FreeRadius users mailing list <freeradius-users@lists.freeradius.org>
AD> Cc: Jilles Tjoelker <jilles@stack.nl>, 
AD>  firebird-devel@lists.sourceforge.net, bug-followup@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@yandex.ru




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1043575287.20120202111356>