Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 06 Oct 2002 15:50:13 -0400
From:      "Andrew Lankford" <arlankfo@141.com>
To:        current@freebsd.org
Subject:   suggested patch for small user ppp annoyance
Message-ID:  <20021006195012.KHCL9318.out016.verizon.net@verizon.net>

next in thread | raw e-mail | index | archive | help

Once in a while, user ppp is killed rather abruptly 
and it leaves a diagnostic socket behind, which  blocks
the creation of a diagnostic socket after reboot.
Anyway, I propose adding another variable to rc.conf, something
along the lines of the three patches here.  The default
value for pppctl_socket would be NO or just "".  In my case however,
I'll set it to "/var/ppp/ppp".

Whaddayall think?

--- usr/src/etc/defaults/rc.conf.orig	Sun Oct  6 02:21:33 2002
+++ usr/src/etc/defaults/rc.conf	Sun Oct  6 12:59:53 2002
@@ -115,6 +115,7 @@
 ppp_nat="YES"		# Use PPP's internal network address translation or NO.
 ppp_profile="papchap"	# Which profile to use from /etc/ppp/ppp.conf.
 ppp_user="root"		# Which user to run ppp as
+pppctl_socket="NO"	# Delete old pppctl diagnostic socket at boot (or NO). 
 
 ### Network daemon (miscellaneous) ###
 syslogd_enable="YES"		# Run syslog daemon (or NO).

--- usr/src/etc/rc.d/ppp-user.orig	Sun Oct  6 01:58:05 2002
+++ usr/src/etc/rc.d/ppp-user	Sun Oct  6 12:59:17 2002
@@ -15,7 +15,16 @@ start_cmd="ppp_start"
 stop_cmd=":"
 
 ppp_start()
-{
+{	
+	# Check for orphaned pppctl diagnostic socket, delete it. 
+	[ "${pppctl_socket}" ] && case ${pppctl_socket} in
+	[Nn][Oo])
+		# Do nothing
+		;;
+	*)
+		[ -S "${pppctl_socket}" ] && rm ${pppctl_socket}
+	esac
+
 	# Establish ppp mode.
 	#
 	if [ "${ppp_mode}" != "ddial" -a "${ppp_mode}" != "direct" \

--- usr/src/etc/rc.network.orig	Sat Sep 21 01:36:18 2002
+++ usr/src/etc/rc.network	Sun Oct  6 12:57:29 2002
@@ -272,6 +272,16 @@ network_pass1() {
 	#
 	case ${ppp_enable} in
 	[Yy][Ee][Ss])
+		# Check for orphaned pppctl diagnostic socket
+		[ "${pppctl_socket" ] && case ${pppctl_socket} in
+		[Nn][Oo])
+			# Don't do anything
+		;;
+		*)
+			# Delete socket if it still exists
+			[ -S "${pppctl_socket}" ] && rm ${pppctl_socket}
+		esac
+
 		# Establish ppp mode.
 		#
 		if [ "${ppp_mode}" != "ddial" -a "${ppp_mode}" != "direct" \

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021006195012.KHCL9318.out016.verizon.net>