On 4/11/07, Alexander E. Patrakov <[EMAIL PROTECTED]> wrote:
I wrote:
> Dan Nicholson wrote:
>> 
http://wiki.linuxfromscratch.org/lfs/changeset?format=diff&new=7962&old=7931&new_path=trunk%2Fbootscripts%2Flfs&old_path=trunk%2Fbootscripts%2Flfs
>>
>> Can you check if these are the same issue?
>
> I will do this tomorrow, thanks for the link.
<snip>
This should (and does) kill only the pppd that is responsible for the pppoe
connection, and should (but doesn't without the patch) print a green [OK] in
the top line of the output. My earlier comment about hibernation is wrong.

There is still another copy of pppd running when this occurs, right? I
think when I was testing things out I never actually had two copies of
the process running. Could you see if the attached patch against SVN
works correctly? Hopefully, this fixes the whole codepath to do the
right thing.

I'll test over here when I have a chance. I think I can probably just
slim it down to getting two daemons running by the same name and
calling killproc -p on one of them.

--
Dan
Index: bootscripts/lfs/init.d/functions
===================================================================
--- bootscripts/lfs/init.d/functions	(revision 8042)
+++ bootscripts/lfs/init.d/functions	(working copy)
@@ -373,7 +373,7 @@
 		for pid in ${lpids}
 		do
 			if [ "${pid}" -ne "$$" -a "${pid}" -ne "${PPID}" ]; then
-				kill -0 "${pid}" > /dev/null &&
+				kill -0 "${pid}" 2>/dev/null &&
 				pidlist="${pidlist} ${pid}"
 			fi
 			
@@ -542,7 +542,7 @@
 	local killsig=""
 	pidlist=""
 
-# This will ensure compatibility with previous LFS Bootscripts
+	# This will ensure compatibility with previous LFS Bootscripts
 	if [ -n "${PIDFILE}" ];	then
 		pidfile="${PIDFILE}"
 	fi
@@ -597,31 +597,25 @@
 		fi
 	done
 
-	if [ -z "${killsig}" ];	then
+	# Check if the process is still running
+	if [ -z "${pidfile}" ];	then
 		pidofproc -s "${1}"
-
-		# Program was terminated
-		if [ "$?" != "0" ]; then
-			# Pidfile Exists
-			if [ -f "${pidfile}" ];	then
-				rm -f "${pidfile}"
-			fi
-			echo_ok
-			return 0
-		else # Program is still running
-			echo_failure
-			return 4 # Unknown Status
-		fi
 	else
-		if [ -z "${pidfile}" ];	then
-			pidofproc -s "${1}"
-		else
-			pidofproc -s -p "${pidfile}" "${1}"
-		fi
+		pidofproc -s -p "${pidfile}" "${1}"
 	fi
 
-	evaluate_retval # This is "Probably" not LSB compliant, but required to be compatible with older bootscripts
-
+	# Program was terminated
+	if [ "$?" != "0" ]; then
+		# Remove the pidfile if necessary
+		if [ -f "${pidfile}" ];	then
+			rm -f "${pidfile}"
+		fi
+		echo_ok
+		return 0
+	else # Program is still running
+		echo_failure
+		return 4 # Unknown Status
+	fi
     else
 	print_status warning not_running
     fi
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to