Here's the relevant code.2013-11-21 23:10:37 [MIME::Lite 13557] : **** DIE!!! **** error closin +g /usr/lib/sendmail: No child processes (exit -1) Additionally, an error occurred sending the alert email: error closin +g /usr/lib/sendmail: No child processes (exit -1) 2013-11-21 23:10:37 [Proc::PID::File 13557] : **** Permission denied a +t /usr/local/share/perl/5.14.2/Proc/PID/File.pm line 224 during globa +l destruction.
And here's the code the starts the process.while (my $row = $get_sth->fetchrow_hashref) { if ($row->{messagetext} && $row->{messagehtml}) { if ($debug == 1) { $row->{recipient} = 'webdev@naplesrentals.com'; $msgcnt++; } my $status = 'sent'; my $message = new MIME::Lite( To => $row->{recipient}, From => $row->{sender}, Subject => $row->{subject}, Type => 'multipart/alternative'); $message->attach(Type=>'text/plain', Data=>$row->{messagetext}); $message->attach(Type=>'text/html', Data=>$row->{messagehtml}); $upd_sth->execute($status, $row->{messageid}); $message->send_by_sendmail or logmsg('Warning'); logmsg("Delivered message: MessageID: " . $row->{messa +geid}); } else { $upd_sth->execute('error', $row->{messageid}); logmsg("Invalid message: MessageID: " . $row->{message +id} . " Next!"); } }
The init_mailer_daemon function ...sub start { my $self = shift; my $name = $self->name; if (my $pid = fork()) { # parent + + exit 0; } #Child + + if (Proc::PID::File->running({name=>$name})) { die "Couldn't start: '$name' already running."; } $self->init_mailer_daemon; }
sub init_mailer_daemon { my $self = shift; my $name = $self->name; print "Starting: '$name'\n"; *CORE::GLOBAL::warn = \&warn_to_log; $SIG{__DIE__} = \&die_to_log; $SIG{__WARN__} = \&warn_to_log; eval { chdir '/' or die $!; open STDIN, '/dev/null' or die $!; open(STDOUT, '>>' . $self->logfile); open(STDERR, '+>&STDOUT'); logmsg('Starting Listmanager'); POSIX::setsid or die $!; logmsg('Successful'); }; if ($@) { die "Couldn't start child '$name': $@"; } local $SIG{CHLD} = 'IGNORE'; &queue; }
In reply to Mime::Lite Sendmail Dying by halfbaked
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |