Date: Mon, 25 Apr 2016 16:45:51 +0000 From: bugzilla-noreply@freebsd.org To: freebsd-ports-bugs@FreeBSD.org Subject: [Bug 209038] security/amavisd-new rc script for p0fanalyzer doesn't work correctl Message-ID: <bug-209038-13@https.bugs.freebsd.org/bugzilla/>
next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D209038 Bug ID: 209038 Summary: security/amavisd-new rc script for p0fanalyzer doesn't work correctl Product: Ports & Packages Version: Latest Hardware: Any OS: Any Status: New Severity: Affects Some People Priority: --- Component: Individual Port(s) Assignee: gabor@FreeBSD.org Reporter: 000.fbsd@quip.cz Assignee: gabor@FreeBSD.org Flags: maintainer-feedback?(gabor@FreeBSD.org) It starts OK but does not restart properly, because kill signal returns imediately, but shutdown of the deamon takes longer time and thus start att= empt failed to bind on already opened socket # service amavis-p0fanalyzer restart Binding to socket [::1]:2345 failed (using IO::Socket::IP): Address already= in use at /usr/local/sbin/p0f-analyzer.pl line 375. p0fanalyzer_stop() should be changed to wait till daemon really die. And should check if daemon is runnig and PID file exists, because second attempt to (re)start p0f emits this error: # service amavis-p0fanalyzer restart cat: /var/run/p0fanalyzer2.pid: No such file or directory usage: kill [-s signal_name] pid ... kill -l [exit_status] kill -signal_name pid ... kill -signal_number pid ... cat: /var/run/p0fanalyzer1.pid: No such file or directory usage: kill [-s signal_name] pid ... kill -l [exit_status] kill -signal_name pid ... kill -signal_number pid ... This error can be fixed by this simple change: p0fanalyzer_stop() { test -s ${amavis_p0fanalyzer_pidfile2} && /bin/kill `cat ${amavis_p0fanalyzer_pidfile2}` && rm ${amavis_p0fanalyzer_pidfile2} test -s ${amavis_p0fanalyzer_pidfile1} && /bin/kill `cat ${amavis_p0fanalyzer_pidfile1}` && rm ${amavis_p0fanalyzer_pidfile1} } I don't know how to handle the first problem with slowly dying daemon. Also I am not sure if there must be the "rm" part in p0fanalyzer_stop() function, because man daemon says that the pid file will be removed. cite: The program is executed in a spawned child process while the daemon waits until it terminates to keep the child_pidfile locked and removes it after the process exits. --=20 You are receiving this mail because: You are the assignee for the bug.=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-209038-13>