tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: ppp rcvar



On Tue, Aug 21, 2012 at 05:26:26PM +0100, David Brownlee wrote:
> On 21 August 2012 16:56, Patrick Welche <prlw1%cam.ac.uk@localhost> wrote:
> > On Tue, Aug 21, 2012 at 10:36:56AM -0500, Jeremy C. Reed wrote:
> >> On Tue, 21 Aug 2012, Patrick Welche wrote:
> >>
> >> > Is the lack of rcvar in rc.d/ppp intentional or an oversight?
> >> >
> >> > (Now I'm not sure if I had put ppp=NO or pppd=NO in rc.conf, and was then
> >> > surprised that the phone was engaged hours after booting)
> >>
> >> http://mail-index.netbsd.org/tech-misc/2008/02/23/msg000005.html
> >>
> >> Some of the thread answers why it happened.
> >
> > It seems that ppp isn't considered in the thread. I would expect ppp=YES to
> > mean at boot run ppp and connect to $ppp_peers | /etc/ppp/peers. If ppp=NO
> > then wait for a /etc/rc.d/ppp onestart.
> >
> > Thoughts?
> 
> Makes perfect sense to me - providing the defaults are left at YES I
> cannot imagine why almost all rc.d files should be checking an
> rcvar...

I was about to apply the attached, but now I'm two minds:

The default would be ppp=YES, ppp_peers="", which means that by default we
would get

./ppp: WARNING: ${ppp_peers} is not set - pppd was not started.

Opinions?

Cheers,

Patrick
Index: etc/defaults/rc.conf
===================================================================
RCS file: /cvsroot/src/etc/defaults/rc.conf,v
retrieving revision 1.120
diff -u -r1.120 rc.conf
--- etc/defaults/rc.conf        13 Aug 2012 08:20:44 -0000      1.120
+++ etc/defaults/rc.conf        13 Jan 2013 12:01:08 -0000
@@ -179,7 +179,7 @@
 dhclient=NO                                    # behave as a DHCP client
                        dhclient_flags=""       # blank: config all interfaces
 ntpdate=NO             ntpdate_flags="-b -s"   # May need '-u' thru firewall
-ppp_peers=""                                   # /etc/ppp/peers to call
+ppp=YES                        ppp_peers=""            # /etc/ppp/peers to call
 ip6mode=host                                   # host, autohost or router
 ip6uniquelocal=NO                              # IPv6 unique-local forwarding
 rtsol=NO               rtsol_flags="-a"        # for ip6mode=autohost only
Index: etc/rc.d/ppp
===================================================================
RCS file: /cvsroot/src/etc/rc.d/ppp,v
retrieving revision 1.10
diff -u -r1.10 ppp
--- etc/rc.d/ppp        13 Dec 2012 21:51:52 -0000      1.10
+++ etc/rc.d/ppp        13 Jan 2013 12:01:08 -0000
@@ -14,6 +14,7 @@
 $_rc_subr_loaded . /etc/rc.subr
 
 name="ppp"
+rcvar=$name
 start_cmd="ppp_start"
 stop_cmd="ppp_stop"
 sig_stop="-INT"
@@ -40,6 +41,8 @@
                        fi
                done
                echo "."
+       else
+               warn "\${ppp_peers} is not set - pppd was not started."
        fi
 }
 
Index: share/man/man5/rc.conf.5
===================================================================
RCS file: /cvsroot/src/share/man/man5/rc.conf.5,v
retrieving revision 1.154
diff -u -r1.154 rc.conf.5
--- share/man/man5/rc.conf.5    2 Oct 2012 09:18:59 -0000       1.154
+++ share/man/man5/rc.conf.5    13 Jan 2013 12:01:19 -0000
@@ -887,9 +887,17 @@
 Run
 .Xr pflogd 8
 for dumping packet filter logging information to a file.
+.It Sy ppp
+A boolean. Toggles starting
+.Xr pppd 8
+on startup. See
+.Sy ppp_peers
+below.
 .It Sy ppp_peers
 A string.
 If
+.Sy ppp
+is true and
 .Sy ppp_peers
 is not empty, then
 .Pa /etc/rc.d/ppp


Home | Main Index | Thread Index | Old Index