Changeset 11227

Show
Ignore:
Timestamp:
08/18/08 08:11:54 (5 months ago)
Author:
/C=ES/O=Warp Networks S.L./CN=ejhernandez@…
Message:

Fix start script session and added finish script session refs #1103

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

Legend:

Unmodified
Added
Removed
  • branches/remote-services/ebox/src/libexec/Makefile.am

    r11201 r11227  
    33scriptsdir = @DATADIR@/ebox 
    44 
    5 scripts_SCRIPTS = ebox-loggerd ebox-kill-pid ebox-start-script-session 
     5scripts_SCRIPTS = ebox-loggerd ebox-kill-pid ebox-start-script-session \ 
     6                  ebox-finish-script-session 
    67 
    78MAINTAINERCLEANFILES = Makefile.in 
  • branches/remote-services/ebox/src/libexec/ebox-start-script-session

    r11201 r11227  
    11#!/usr/bin/perl 
    22 
     3use EBox; 
    34use EBox::Config; 
    45use Fcntl qw(:flock); 
     6 
     7EBox::init(); 
     8 
     9my $time = time(); 
     10if ( @ARGV > 0 ) { 
     11    $time = $ARGV[0]; 
     12} 
    513 
    614my $sessionFile; 
     
    1018} 
    1119open ($sessionFile, $openMode, EBox::Config->scriptSession() ) 
    12   die 'Could not open ' . EBox::Config->scriptSession() . ": $!"; 
     20  or die 'Could not open ' . EBox::Config->scriptSession() . ": $!"; 
    1321 
    1422# Lock the file in exclusive mode 
    1523flock($sessionFile, LOCK_EX) 
    16   die 'Could not get the lock for ' . EBox::Config->scriptSession() . ": $!"; 
     24  or die 'Could not get the lock for ' . EBox::Config->scriptSession() . ": $!"; 
    1725 
    1826# Truncate the file before writing 
    1927truncate( $sessionFile, 0); 
    20 print $sessionFile time() . $/; 
     28print $sessionFile "$time$/"; 
    2129 
    2230# Release the lock and close the file