Changeset 11227
- Timestamp:
- 08/18/08 08:11:54 (5 months ago)
- Location:
- branches/remote-services/ebox/src/libexec
- Files:
-
- 1 added
- 2 modified
-
Makefile.am (modified) (1 diff)
-
ebox-finish-script-session (added)
-
ebox-start-script-session (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/remote-services/ebox/src/libexec/Makefile.am
r11201 r11227 3 3 scriptsdir = @DATADIR@/ebox 4 4 5 scripts_SCRIPTS = ebox-loggerd ebox-kill-pid ebox-start-script-session 5 scripts_SCRIPTS = ebox-loggerd ebox-kill-pid ebox-start-script-session \ 6 ebox-finish-script-session 6 7 7 8 MAINTAINERCLEANFILES = Makefile.in -
branches/remote-services/ebox/src/libexec/ebox-start-script-session
r11201 r11227 1 1 #!/usr/bin/perl 2 2 3 use EBox; 3 4 use EBox::Config; 4 5 use Fcntl qw(:flock); 6 7 EBox::init(); 8 9 my $time = time(); 10 if ( @ARGV > 0 ) { 11 $time = $ARGV[0]; 12 } 5 13 6 14 my $sessionFile; … … 10 18 } 11 19 open ($sessionFile, $openMode, EBox::Config->scriptSession() ) 12 die 'Could not open ' . EBox::Config->scriptSession() . ": $!";20 or die 'Could not open ' . EBox::Config->scriptSession() . ": $!"; 13 21 14 22 # Lock the file in exclusive mode 15 23 flock($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() . ": $!"; 17 25 18 26 # Truncate the file before writing 19 27 truncate( $sessionFile, 0); 20 print $sessionFile time() . $/;28 print $sessionFile "$time$/"; 21 29 22 30 # Release the lock and close the file
