fix daemonize bits

This commit is contained in:
Zane C. B-H 2022-10-19 02:54:27 -05:00
parent 43a44d38bd
commit 0831d2059a
1 changed files with 8 additions and 4 deletions

View File

@ -1,4 +1,4 @@
#!/usr/bin/env perl
#!/usr/local/bin/perl
use strict;
use warnings;
@ -136,6 +136,8 @@ my $event_id;
my $id;
my $decode_raw;
my $daemonize;
my $user = 0;
my $group = 0;
Getopt::Long::Configure('no_ignore_case');
Getopt::Long::Configure('bundling');
GetOptions(
@ -186,6 +188,8 @@ GetOptions(
'event=s' => \$event_id,
'raw' => \$decode_raw,
'daemonize' => \$daemonize,
'user=s' => \$user,
'group=s' => \$user,
);
# print version or help if requested
@ -347,9 +351,9 @@ if ( $action eq 'run' ) {
print "\nConfigured Instances...\n" . to_toml( \%files ) . "\n\n\nCalling Lilith->run now....\n";
if (!$daemonize) {
daemonize( undef, undef, '/var/run/lilith/pid' );
};
if ( $daemonize ) {
daemonize( $user, $group, '/var/run/lilith/pid' );
}
$lilith->run( files => \%files, );
}