#!/usr/bin/perl -w use esmith::ConfigDB; my $c = esmith::ConfigDB->open_ro or die "Couldn't open ConfigDB\n"; my $rec = $c->get('samba-db-logd'); my $dbname = $rec->prop('DbName') || 'samba_log'; my $dbuser = $rec->prop('DbUser') || 'samba'; my $dbpass = $rec->prop('DbPassword') || 'samba'; my $dbhost = $rec->prop('DbHost') || 'localhost'; my @args = ("--debug=1", "--dbname=$dbname", "--dbuser=$dbuser", "--dbpass=$dbpass"); push @args, "--dbhost=$dbhost" if ($dbhost ne 'localhost'); my $smbd = $c->get('smbd'); if ($smbd ne 'enabled'){ exec("sv", "d", "/service/samba-db-logd"); exit(0); } exec("/usr/bin/squid-db-logd", @args) or die "Cannot run the Samba Database Loggind Daemon"; exit(1);