version => $VERSION,
listening => {},
pidmap => {},
+ exit_on_nosync => 0,
sqlprefix => "/* Bucardo $VERSION */",
};
## This resets listeners, kills kids, and loads/activates syncs
my $active_syncs = $self->reload_mcp();
- ## No syncs means no reason for us to hang around, so we exit
- if (!$active_syncs) {
+ if (!$active_syncs && $self->{exit_on_nosync}) {
+ ## No syncs means no reason for us to hang around, so we exit
$self->glog('No active syncs were found, so we are exiting', LOG_WARN);
$self->db_notify($masterdbh, 'nosyncs', 1);
$self->cleanup_mcp('No active syncs');
'dryrun|dry-run',
'confirm',
'tsep=s',
+ 'exit-on-nosync!',
## These are sent to the constructor:
'bcverbose',
## Create a new Bucardo daemon
require Bucardo;
+ $bcargs->{exit_on_nosync} = delete $bcargs->{'exit-on-nosync'}
+ if exists $bcargs->{'exit-on-nosync'};
my $bc = Bucardo->new($bcargs);
## Verify that the version of Bucardo.pm matches our version
Forces removal of all old debug files before running.
+=item B<--exit-on-nosync>
+
+=item B<--no-exit-on-nosync>
+
+On startup, if Bucardo finds no active syncs, it normally will continue to
+run, requiring a restart once syncs are added. This is useful for startup
+scripts and whatnot.
+
+If, however, you want it to exit when there are no active syncs, pass the
+C<--exit-on-nosync> option. You can also be explicit that it should I<not>
+exit when there are no syncs by passing C<--no-exit-on-nosync>. This is the
+default value.
+
=back
=head1 FILES