Changeset 2496
- Timestamp:
- 11/30/21 14:55:37 (3 years ago)
- Location:
- trunk/LATMOS-Accounts
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LATMOS-Accounts/bin/la-sync-manager
r2023 r2496 146 146 { 147 147 my $LA = LATMOS::Accounts->new($config, noacl => 1); 148 if ( $LA->val('_default_', 'state_dir')) {149 $pidfile = $ LA->val('_default_', 'state_dir'). '/sync-manager.pid';148 if (my $dir = $LA->state_dir) { 149 $pidfile = $dir . '/sync-manager.pid'; 150 150 } 151 151 if (my $mail = $LA->val('_network_', 'maillog')) { -
trunk/LATMOS-Accounts/lib/LATMOS/Accounts.pm
r2495 r2496 96 96 97 97 $self 98 } 99 100 =head2 state_dir 101 102 Return state_dir for this instance 103 104 =cut 105 106 sub state_dir { 107 my ( $self ) = @_; 108 109 return $self->val( '_default_', 'state_dir', '/var/lib/latmos-accounts' ); 98 110 } 99 111 … … 289 301 my $sync = LATMOS::Accounts::Synchro->new( 290 302 $labfrom, [ @labto ], 291 state_dir => ($self->val('_default_', 'state_dir') || undef),303 state_dir => $self->state_dir, 292 304 %options, 293 305 name => $name, … … 340 352 sub call_batch_sync { 341 353 my ($self) = @_; 342 if (my $sd = $self-> val('_default_', 'state_dir')) {354 if (my $sd = $self->state_dir) { 343 355 if (open(my $fh, '<', $sd . '/sync-manager.pid')) { 344 356 my $pid = <$fh> || ''; -
trunk/LATMOS-Accounts/lib/LATMOS/Accounts/SyncManager.pm
r2439 r2496 61 61 sub ini { $_[0]->{ini} } 62 62 63 =head2 LA64 65 Return a LATMOS::Accounts setup for SynchM66 67 =cut68 69 sub LA {70 my ( $self ) = @_;71 72 return LATMOS::Accounts->new($self->{config}, noacl => 1, loguser => '@SyncManager');73 }74 75 63 =head2 dbrev 76 64 … … 81 69 sub dbrev { 82 70 my ($self) = @_; 83 my $LA = $self->LA;71 my $LA = LATMOS::Accounts->new($self->{config}, noacl => 1); 84 72 my $base = $LA->base; 85 73 return $base->current_rev; … … 88 76 sub _load_state_ini { 89 77 my ($self) = @_; 90 my $la = $self->LA; 91 92 my $state_file = $la->val('_default_', 'state_dir', '/'); 93 $state_file .= '/la-sync-manager.ini'; 78 my $la = LATMOS::Accounts->new($self->{config}, noacl => 1); 79 80 my $state_file = $la->state_dir . '/la-sync-manager.ini'; 94 81 la_log(LA_DEBUG, "Status file is %s", $state_file); 95 82 if ($state_file && ! -w $state_file) { -
trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Task/Buildnet.pm
r2439 r2496 121 121 return $self->{_bnet_state} if ($self->{_bnet_state}); 122 122 # where trace goes: 123 my $state_file = $self->_la->val('_default_', 'state_dir', '/'); 124 $state_file .= '/buildnet_state.ini'; 123 my $state_file = $self->state_dir . '/buildnet_state.ini'; 125 124 la_log(LA_DEBUG, "Status file is %s", $state_file); 126 125 if ($state_file && ! -w $state_file) { … … 159 158 '/', 160 159 $self->_la->val('_network_', 'output_dir', 161 ($self->_la-> val('_default_', 'state_dir'), $ozone->get_attributes('type'))160 ($self->_la->state_dir, $ozone->get_attributes('type')) 162 161 ) 163 162 );
Note: See TracChangeset
for help on using the changeset viewer.