Changeset 11201

Show
Ignore:
Timestamp:
08/14/08 15:01:58 (5 months ago)
Author:
/C=ES/O=Warp Networks S.L./CN=ejhernandez@…
Message:

Added support for starting script (previously known as soap) from cmd line refs #1103

Location:
branches/remote-services/ebox/src
Files:
1 added
3 modified

Legend:

Unmodified
Added
Removed
  • branches/remote-services/ebox/src/EBox/Auth.pm

    r10308 r11201  
    3636# By now, the expiration time for session is hardcoded here 
    3737use constant EXPIRE => 3600; #In seconds  1h 
    38 # By now, the expiration time for a SOAP session 
    39 use constant MAX_SOAP_SESSION => 10; # In seconds 
     38# By now, the expiration time for a script session 
     39use constant MAX_SCRIPT_SESSION => 10; # In seconds 
    4040 
    4141sub new  
     
    160160    my ($self, $r, $passwd) = @_; 
    161161 
    162     # If there's a SOAP session opened, give it priority to the 
     162    # If there's a script session opened, give it priority to the 
    163163    # Web interface session 
    164     if ( $self->_activeSOAPSession() ){ 
    165       EBox::warn('Failed login since a SOAP session is opened'); 
    166       $r->subprocess_env(LoginReason => 'SOAP active'); 
     164    if ( $self->_actionScriptSession() ){ 
     165      EBox::warn('Failed login since a script session is opened'); 
     166      $r->subprocess_env(LoginReason => 'Script active'); 
    167167      return; 
    168168    } 
     
    199199    my $expired =  _timeExpired($lastime); 
    200200 
    201     if ( $self->_activeSOAPSession() ) { 
    202       $r->subprocess_env(LoginReason => 'SOAP active'); 
     201    if ( $self->_actionScriptSession() ) { 
     202      $r->subprocess_env(LoginReason => 'Script active'); 
    203203      _savesession(undef); 
    204204    } 
     
    296296} 
    297297 
    298 # Method: _activeSOAPSession 
    299 # 
    300 #       Check whether a SOAP session is already opened or not 
     298# Method: _actionScriptSession 
     299# 
     300#       Check whether a script session is already opened or not 
    301301# 
    302302# Returns: 
    303303# 
    304 #       Boolean - indicate if a SOAP session is already opened 
    305 # 
    306 sub _activeSOAPSession 
     304#       Boolean - indicate if a script session is already opened 
     305# 
     306sub _actionScriptSession 
    307307  { 
    308308 
    309309    my ($self) = @_; 
    310310 
    311     # The SOAP session filehandle 
    312     my $soapSessionFile; 
    313  
    314     unless ( -e EBox::Config->soapSession() ){ 
     311    # The script session filehandle 
     312    my $scriptSessionFile; 
     313 
     314    unless ( -e EBox::Config->scriptSession() ){ 
    315315      return undef; 
    316316    } 
    317317 
    318     # Trying to open the soap sid 
    319     open( $soapSessionFile, '<', EBox::Config->soapSession() ) or 
     318    # Trying to open the script sid 
     319    open( $scriptSessionFile, '<', EBox::Config->scriptSession() ) or 
    320320      throw EBox::Exceptions::Internal('Could not open ' . 
    321                                        EBox::Config->soapSession()); 
     321                                       EBox::Config->scriptSession()); 
    322322 
    323323    # Lock in shared mode 
    324     flock($soapSessionFile, LOCK_SH) 
     324    flock($scriptSessionFile, LOCK_SH) 
    325325      or throw EBox::Exceptions::Lock($self); 
    326326 
    327327    # The file structure is the following: 
    328328    # TIMESTAMP 
    329     my ($timeStamp) = <$soapSessionFile>; 
     329    my ($timeStamp) = <$scriptSessionFile>; 
    330330 
    331331    # Release the lock and close the file 
    332     flock($soapSessionFile, LOCK_UN); 
    333     close($soapSessionFile); 
     332    flock($scriptSessionFile, LOCK_UN); 
     333    close($scriptSessionFile); 
    334334 
    335335    # time() return the # of seconds since an epoch (1 Jan 1970 
    336336    # typically) 
    337337 
    338     my $expireTime = $timeStamp + MAX_SOAP_SESSION; 
     338    my $expireTime = $timeStamp + MAX_SCRIPT_SESSION; 
    339339    return ( $expireTime >= time() ); 
    340340 
  • branches/remote-services/ebox/src/EBox/CGI/Login/Index.pm

    r10308 r11201  
    5858 
    5959        my $reason; 
    60         if ( (defined ($envre) ) and ($envre eq 'SOAP active') ) { 
    61           $reason = __('There is a Web service script running. ' . 
     60        if ( (defined ($envre) ) and ($envre eq 'Script active') ) { 
     61          $reason = __('There is a script which has asked to run in eBox exclusively. ' . 
    6262                       'Please, wait patiently until it is done'); 
    6363        } 
  • branches/remote-services/ebox/src/libexec/Makefile.am

    r10308 r11201  
    33scriptsdir = @DATADIR@/ebox 
    44 
    5 scripts_SCRIPTS = ebox-loggerd ebox-kill-pid  
     5scripts_SCRIPTS = ebox-loggerd ebox-kill-pid ebox-start-script-session 
    66 
    77MAINTAINERCLEANFILES = Makefile.in