Skip to contentSkip to conversation

make sure that the linkpidfile is always created

PATCH In review Marco d'Itri 2 participants 2 messages Aug 19, 2007 PPP protocol drivers and compressors

lore
Share & tools
lore
#0 lore raw

PATCH 6/14 make sure that the linkpidfile is always created

Subject: [patch 06/14] Bug#284382: ppp: linkpidfile is not created upon detachment
From: <[email protected]>

Package: ppp
Version: 2.4.2+20040428-2
Severity: wishlist

When pppd detaches from the parent normally, that is, without nodetach or updetach set, the linkpidfile is not created even when linkname is set.

This is because the create_linkpidfile call in detach() is only made if the linkpidfile is filled in. However, linkpidfile is never filled in until create_linkpidfile has been called.

IMHO the call should be made uncondtionally in detach() since create_linkpidfile does its own check on linkname anyway.

Please note that the version of pppd in woody always wrote the linkpidfile after detaching. It did so in main() however. That call has now been removed which is why I'm seeing this problem.

[...]

--
Index: pppd/main.c
=================================RCS file: /var/cvs/snwb/packages/ppp/pppd/main.c,v retrieving revision 1.11

pppd/main.c +1 -2
diff -u -r1.11 main.c
@@ -819,8 +819,7 @@
 	/* update pid files if they have been written already */
 	if (pidfilename[0])
 	    create_pidfile(pid);
-	if (linkpidfile[0])
-	    create_linkpidfile(pid);
+	create_linkpidfile(pid);
 	exit(0);		/* parent dies */
     }
     setsid();
Signature · 2 lines
ciao,
Marco
#1 lore raw
Quoted 11 lines · Marco d'Itri

Subject: [patch 06/14] Bug#284382: ppp: linkpidfile is not created upon detachment
From: <[email protected]>

Package: ppp
Version: 2.4.2+20040428-2
Severity: wishlist

When pppd detaches from the parent normally, that is, without nodetach or updetach set, the linkpidfile is not created even when linkname is set.

Quoted 6 lines

This is because the create_linkpidfile call in detach() is only made if the linkpidfile is filled in. However, linkpidfile is never filled in until create_linkpidfile has been called.

IMHO the call should be made uncondtionally in detach() since create_linkpidfile does its own check on linkname anyway.

There is an unconditional call to create_linkpidfile in main() at line
475. The call in detach is only there to rewrite the file in the case where it has already been created by the parent and needs to be updated to reflect the new process ID after detaching (since detaching involves a fork).

Quoted 3 lines

Please note that the version of pppd in woody always wrote the linkpidfile after detaching. It did so in main() however. That call has now been removed which is why I'm seeing this problem.

It's still there in my version. Was it a debian-specific patch that removed it, perhaps?

Paul.