mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-26 23:45:44 +00:00
Use new Daemon API.
This commit is contained in:
@@ -14039,17 +14039,12 @@ sub main {
|
|||||||
# ########################################################################
|
# ########################################################################
|
||||||
# Daemonize now that everything is setup and ready to work.
|
# Daemonize now that everything is setup and ready to work.
|
||||||
# ########################################################################
|
# ########################################################################
|
||||||
my $daemon;
|
my $daemon = Daemon->new(
|
||||||
if ( $o->get('daemonize') ) {
|
daemonize => $o->get('daemonize'),
|
||||||
$daemon = new Daemon(o=>$o);
|
pid_file => $o->get('pid'),
|
||||||
$daemon->daemonize();
|
log_file => $o->get('log'),
|
||||||
PTDEBUG && _d('I am a daemon now');
|
);
|
||||||
}
|
$daemon->run();
|
||||||
elsif ( $o->get('pid') ) {
|
|
||||||
# We're not daemoninzing, it just handles PID stuff.
|
|
||||||
$daemon = new Daemon(o=>$o);
|
|
||||||
$daemon->make_PID_file();
|
|
||||||
}
|
|
||||||
|
|
||||||
# ########################################################################
|
# ########################################################################
|
||||||
# Do the version-check
|
# Do the version-check
|
||||||
|
@@ -32,8 +32,8 @@ my $pid_file = '/tmp/pt-query-digest.test.pid';
|
|||||||
$output = `$trunk/bin/pt-query-digest $trunk/commont/t/samples/slow002.txt --pid $pid_file 2>&1`;
|
$output = `$trunk/bin/pt-query-digest $trunk/commont/t/samples/slow002.txt --pid $pid_file 2>&1`;
|
||||||
like(
|
like(
|
||||||
$output,
|
$output,
|
||||||
qr{PID file $pid_file already exists},
|
qr{PID file $pid_file exists},
|
||||||
'Dies if PID file already exists (--pid without --daemonize) (issue 391)'
|
'Dies if PID file exists (--pid without --daemonize) (issue 391)'
|
||||||
);
|
);
|
||||||
`rm $pid_file >/dev/null 2>&1`;
|
`rm $pid_file >/dev/null 2>&1`;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user