From owner-freebsd-bugs@FreeBSD.ORG Mon Oct 11 09:50:24 2004 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 83A2216A4CF for ; Mon, 11 Oct 2004 09:50:24 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 60FE243D49 for ; Mon, 11 Oct 2004 09:50:24 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.11/8.12.11) with ESMTP id i9B9oO3F070095 for ; Mon, 11 Oct 2004 09:50:24 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.11/8.12.11/Submit) id i9B9oOVg070092; Mon, 11 Oct 2004 09:50:24 GMT (envelope-from gnats) Resent-Date: Mon, 11 Oct 2004 09:50:24 GMT Resent-Message-Id: <200410110950.i9B9oOVg070092@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Amir Shalem Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DD71516A4CE for ; Mon, 11 Oct 2004 09:48:15 +0000 (GMT) Received: from sa6.bezeqint.net (sa6.bezeqint.net [192.115.104.20]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9DFA043D2D for ; Mon, 11 Oct 2004 09:48:14 +0000 (GMT) (envelope-from amir@active.ath.cx) Received: from localhost (unknown [127.0.0.1])ESMTP id AE46D33BBF for ; Mon, 11 Oct 2004 11:46:05 +0200 (IST) Received: from sa6.bezeqint.net ([127.0.0.1]) by localhost (sa6 [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 19808-09 for ; Mon, 11 Oct 2004 11:46:05 +0200 (IST) Received: from active.ath.cx (unknown [81.218.66.74])ESMTP for ; Mon, 11 Oct 2004 11:46:05 +0200 (IST) Received: from localhost (localhost.active.ath.cx [127.0.0.1]) by active.ath.cx (Postfix) with ESMTP id 4EBB65D26 for ; Mon, 11 Oct 2004 11:48:12 +0200 (IST) Received: from active.ath.cx ([127.0.0.1]) by localhost (active.ath.cx [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 86693-07 for ; Mon, 11 Oct 2004 11:48:06 +0200 (IST) Received: by active.ath.cx (Postfix, from userid 1000) id 337A05D25; Mon, 11 Oct 2004 11:48:06 +0200 (IST) Message-Id: <20041011094806.337A05D25@active.ath.cx> Date: Mon, 11 Oct 2004 11:48:06 +0200 (IST) From: Amir Shalem To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: misc/72505: [patch] Fix rc.d/ppp-user to make use of rc.subr X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Amir Shalem List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Oct 2004 09:50:24 -0000 >Number: 72505 >Category: misc >Synopsis: [patch] Fix rc.d/ppp-user to make use of rc.subr >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Oct 11 09:50:20 GMT 2004 >Closed-Date: >Last-Modified: >Originator: Amir Shalem >Release: FreeBSD 6.0-CURRENT i386 >Organization: >Environment: System: FreeBSD active.ath.cx 6.0-CURRENT FreeBSD 6.0-CURRENT #0: Sun Oct 10 18:53:39 IST 2004 amir@active.ath.cx:/usr/obj/usr/src/sys/ACTIVE i386 >Description: /etc/rc.d/ppp-user, the script which controls /usr/sbin/ppp doesn't support many rc.subr features, such as `ppp_nice`. because the script starts the /usr/sbin/ppp manually which includes the `su`ing part. >How-To-Repeat: set ppp_nice in rc.conf, and see it doesn't change a thing. >Fix: Apply this patch: --- etc/defaults/rc.conf.orig Mon Oct 11 11:41:47 2004 +++ etc/defaults/rc.conf Mon Oct 11 11:42:30 2004 @@ -142,6 +142,7 @@ # User ppp configuration. ppp_enable="NO" # Start user-ppp (or NO). +ppp_program="/usr/sbin/ppp" # path to user-ppp program. ppp_mode="auto" # Choice of "auto", "ddial", "direct" or "dedicated". # For details see man page for ppp(8). Default is auto. ppp_nat="YES" # Use PPP's internal network address translation or NO. --- etc/rc.d/ppp-user.orig Sun Oct 10 16:26:35 2004 +++ etc/rc.d/ppp-user Mon Oct 11 11:37:58 2004 @@ -10,11 +10,11 @@ . /etc/rc.subr name="ppp" -rcvar="ppp_enable" -start_cmd="ppp_start" -stop_cmd=":" +rcvar=`set_rcvar` +start_precmd="ppp_precmd" +start_postcmd="ppp_postcmd" -ppp_start() +ppp_precmd() { # Establish ppp mode. # @@ -24,21 +24,21 @@ ppp_mode="auto" fi - ppp_command="/usr/sbin/ppp -quiet -${ppp_mode}" + rc_flags="$rc_flags -quiet -${ppp_mode}" # Switch on NAT mode? # case ${ppp_nat} in [Yy][Ee][Ss]) - ppp_command="${ppp_command} -nat" + rc_flags="${rc_flags} -nat" ;; esac - ppp_command="${ppp_command} ${ppp_profile}" - - echo "Starting ppp as \"${ppp_user}\"" - su -m ${ppp_user} -c "exec ${ppp_command}" + rc_flags="${rc_flags} ${ppp_profile}" +} +ppp_postcmd() +{ # Re-Sync ipfilter so it picks up any new network interfaces # /etc/rc.d/ipfilter resync >Release-Note: >Audit-Trail: >Unformatted: