Skip to content

Commit

Permalink
tidy & daemon mode improvment
Browse files Browse the repository at this point in the history
  • Loading branch information
nikopol committed May 9, 2012
1 parent d2b825b commit 68fe77c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions bin/joq
Expand Up @@ -14,8 +14,8 @@ GetOptions(
'log|l=s' => \my $logmode,
'loglevel|ll=s' => \my $loglevel,
'logfile|lf=s' => \my $logfile,
's|server=s' => \my $server,
'b|backup=s' => \my $backup,
's|server=s' => \my $server,
'b|backup=s' => \my $backup,
'polling|poll|p=s' => \my $polling,
'timezone|tz=s' => \my $timezone,
'oneshot|os|q' => \my $oneshot,
Expand Down Expand Up @@ -171,10 +171,10 @@ if( $daemonize ) {
open STDIN, '/dev/null' or die "can't read /dev/null: $!";
open STDOUT, '>/dev/null' or die "can't write to /dev/null: $!";
defined(my $pid = fork) or die "can't fork: $!";
exit if $pid;
exit 0 if $pid;
die "can't start a new session: $!" if setsid == -1;
open STDERR, '>&STDOUT' or die "can't dup stdout: $!";
delete $o{log_screen};
delete $o{log_mode};
}

joq::run( %o );

0 comments on commit 68fe77c

Please sign in to comment.