Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 15333 - /etc/init.d/net.ppp0 script doesn't remove ${svcdir}/started/net.ppp0 link
Summary: /etc/init.d/net.ppp0 script doesn't remove ${svcdir}/started/net.ppp0 link
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High minor (vote)
Assignee: Martin Schlemmer (RETIRED)
URL:
Whiteboard:
Keywords:
: 15336 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-02-08 17:46 UTC by Derek Dolney
Modified: 2003-04-25 09:41 UTC (History)
3 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 Derek Dolney 2003-02-08 17:46:10 UTC
The following lines(##35-39) in /etc/init.d/net.ppp0 don't work because
runscript.sh removes the link before stop() in net.ppp0 is executed:

                # Do our own cleanup
                if [ -L ${svcdir}/started/net.${IFACE} ]
                then
                        rm -f ${svcdir}/started/net.${IFACE}
                fi

But runscript.sh later restores the link. This is inconvenient because it is
impossible to restore a lost connection without removing the
${svcdir}/started/net.ppp0 link by hand.


Reproducible: Always
Steps to Reproduce:
1./etc/init.d/net.ppp0 start
2.Break connection (e.g., unplug phone line from modem for a few seconds)
3.Try to reconnect with /etc/init.d/net.ppp0 start/stop

Actual Results:  
/etc/init.d/net.ppp0 stop:
ppp0 not up

/etc/init.d/net.ppp0 start
ppp0 already up

Expected Results:  
Would be good if "/etc/init.d/net.ppp0" stop would remove the link so the
/etc/init.d/net.ppp0 start can restore the connection.

Better if "/etc/init.d/net.ppp0" start checks that link is broken and restores
connection.
Comment 1 Martin Holzer (RETIRED) gentoo-dev 2003-02-08 18:14:54 UTC
*** Bug 15336 has been marked as a duplicate of this bug. ***
Comment 2 Martin Schlemmer (RETIRED) gentoo-dev 2003-04-24 16:32:03 UTC
This should fix it .. please test.

----------------------------------------------
Index: init.d/net.ppp0
===================================================================
RCS file: /home/cvsroot/gentoo-src/rc-scripts/init.d/net.ppp0,v
retrieving revision 1.9
diff -u -r1.9 net.ppp0
--- init.d/net.ppp0	6 Jan 2003 21:32:43 -0000	1.9
+++ init.d/net.ppp0	24 Apr 2003 21:29:52 -0000
@@ -27,20 +27,6 @@
 		eerror "ppp0 is already up"
 		return 1
 	fi
-
-	if [ ! -e "/var/run/ppp-${IFACE}.pid" -a "${FUNCT}" = "stop" ]
-	then
-		eerror "ppp0 not up"
-		
-		# Do our own cleanup
-		if [ -L ${svcdir}/started/net.${IFACE} ]
-		then
-			rm -f ${svcdir}/started/net.${IFACE}
-		fi
-
-		return 1
-	fi
-						
 }
 
 start() {
@@ -77,7 +63,9 @@
 		if [ -z "$(/sbin/ifconfig | egrep "${IFACE}")" ]
 		then
 			eerror "Interface seems to be down already"
-			return 1
+			# We should return 0 here, else svc_stop() will not remove
+			# the 'started' symlink ...
+			return 0
 		fi
 		
 #		/sbin/ifconfig ${IFACE} down
Comment 3 Derek Dolney 2003-04-25 09:41:44 UTC
Yes, this works for me.