Package: nfsen
Version: 1.3.6p1

The error happens when the pid files were created without any value. Also
when nfsen.pid  have a null value

Error if nfsen.pid has null content.
Use of uninitialized value $pid in scalar chomp at
/data/nfsen/libexec/NfSenRC.pm line 201.
Can't kill a non-numeric process ID at /data/nfsen/libexec/NfSenRC.pm line
203.

Error if p995.pid has null value.
Starting nfcapd:(Device)Use of uninitialized value $pid in scalar chomp at
/data/nfsen/libexec/NfSenRC.pm line 357.
Can't kill a non-numeric process ID at /data/nfsen/libexec/NfSenRC.pm line
359.

I suggest changes in the /data/nfsen/libexec/NfSenRC.pm

LINE: 196,1-8

***** ACTUAL *******
        # Check if NfSen is already running
        if ( -f "$NfConf::PIDDIR/nfsend.pid" ) {
                open PID, "$NfConf::PIDDIR/nfsend.pid" ||
                        die "Can't read pid file
'$NfConf::PIDDIR/nfsend.pid': $!\n";
                my $pid = <PID>;
                chomp $pid;
                close PID;
                if ( kill( 0, $pid) == 1  ) {
                        print "NfSen is already running!\n";
                        return;
                } else {
                        print "Unclean shutdown - run stop sequence first
to clean up!\n";
                        NfSen_stop();
                }
        }

***** CHANGES *******
        # Check if NfSen is already running
        if ( -f "$NfConf::PIDDIR/nfsend.pid" ) {
                open PID, "$NfConf::PIDDIR/nfsend.pid" ||
                        die "Can't read pid file
'$NfConf::PIDDIR/nfsend.pid': $!\n";
                my $pid = <PID>;
                close PID;

        if ($pid) {
                        chomp $pid;
                           if ( kill( 0, $pid) == 1  ) {
                                print "NfSen is already running!\n";
                                return;
                        } else {
                                print "Unclean shutdown - run stop sequence
first to clean up!\n";
                                NfSen_stop();
                        }
                } else {
                        unlink "$pidfile";
                }
        }



LINE: 353,2-9

***** ACTUAL *******
        if ( -f "$pidfile" ) {
                open PID, "$pidfile" ||
                        die "Can't read pid file '$pidfile': $!\n";
                my $pid = <PID>;
                chomp $pid;
                close PID;
                if ( kill( 0, $pid) == 0  ) {
                        unlink "$pidfile";
                        return -1;
                } else {
                        return $pid;
                }
        } else {
                return 0;
        }


***** CHANGES *******
    if ( -f "$pidfile" ) {
                open PID, "$pidfile" ||
                        die "Can't read pid file '$pidfile': $!\n";
                my $pid = <PID>;
                close PID;

                if ($pid) {
                        chomp $pid;
                        if ( kill( 0, $pid) == 0  ) {
                                unlink "$pidfile";
                                return -1;
                        } else {
                                return $pid;
                        }
                } else {
                        unlink "$pidfile";
                }

        } else {
                return 0;
        }

I am using Linux HOST 3.16.0-4-amd64 #1 SMP Debian 3.16.39-1+deb8u2
(2017-03-07) x86_64 GNU/Linu

​Thank you very much.

Alfredo​ Nacino

Reply via email to