Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 626580 - net-proxy/nylon-1.21-r2: per-connection fork() removes pidfile
Summary: net-proxy/nylon-1.21-r2: per-connection fork() removes pidfile
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Deadline: 2019-06-18
Assignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it
URL:
Whiteboard:
Keywords: NeedPatch, PMASKED
Depends on:
Blocks:
 
Reported: 2017-07-30 06:51 UTC by Markus Osterhoff
Modified: 2019-06-20 08:02 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Osterhoff 2017-07-30 06:51:12 UTC
Bug: after some while, /etc/init.d/nylond status reports "crashed", although daemon is still running

Expected behaviour: report "running"

Description:
nylon-1.21-r2 creates a pidfile which start-stop-daemon puts into good use. This pidfile is removed on program exit; but also for every listener fork() inside net_accept(). Hence, after one proxy connection has been closed, the pidfile goes away, and /etc/init.d/nylond status reports the nylon as crashed. Although it hasn't.

I will contact upstream; for the time being, the problem can be mitigated by removing line nylon.c:205 (add cleanup handler to remove pidfile):


osti@e7240 /mnt/ram/nylon-1.21/src $ diff -Naur nylon.c.org nylon.c
--- nylon.c.org	2017-07-30 08:39:21.029183552 +0200
+++ nylon.c	2017-07-30 08:39:23.560262365 +0200
@@ -202,7 +202,7 @@
 		if ((pidf = fopen(pidfilenam, "w")) != NULL) {
 			fprintf(pidf, "%d\n", getpid());
 			fclose(pidf);
-			cleanup_add(cleanup, unlink_pidfile_cb, pidfilenam);
+			// cleanup_add(cleanup, unlink_pidfile_cb, pidfilenam);
 		} else {
 			warnv(1, "Failed creating PIDfile %s", pidfilenam);
 		}
Comment 1 Jonas Stein gentoo-dev 2017-07-30 09:33:38 UTC
Thank you. Please put a link here if there is an public bug ticket.
Comment 2 Pacho Ramos gentoo-dev 2018-07-13 08:58:05 UTC
I guess init.d script needs to get adapted to that behavior instead of adjusting program behavior to init.d file (maybe trying to run the program in foreground to not rely on that pid file)
Comment 3 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2019-06-20 08:02:52 UTC
Package removed.