A couple of PPP related questions
Dominic Mitchell
dom at happygiraffe.net
Tue May 15 07:42:32 BST 2001
On Mon, May 14, 2001 at 12:52:37PM +0100, Neil Ford wrote:
> On Sun, May 13, 2001 at 11:48:55PM +0100, Paul Civati wrote:
> > Neil Ford <neil at ourshack.com> wrote:
> >
> > > Is it possible to get PPP to write it's process ID out to a file?
> >
> > Don't most daemons log to a file in /var/run?
> >
> This isn't running as a deamon though, I'm using userland PPP.
It depends. If you're running userland ppp in dial-on-demand mode:
% psg ppp
PID TT STAT TIME COMMAND
170 ?? Is 0:00.34 /usr/sbin/ppp -quiet -auto -nat demon
Then ppp will log it's pid to /var/run/tun0.pid
> > > Whats the best way to extract the dynamic IP address that's been
> > > allocated to a machine by an ISP. I ideally want the machine to
> > > mail this detail out everytime it makes the connection. You can
> > > probably guess where I'm going with this one :-)
> >
> > There are plenty of free dynamic DNS services too.
> >
> I don't really need dynamic DNS, I just want to be notified of the dynamic IP
> that a customer's dial-up box has been assigned in case I need to ssh to it
> in an emergancy to do some support.
As others have suggested, that's probably best done from the ppp.linkup
file. For example, I run my mail queue from there:
demon:
!bg /usr/sbin/sendmail -q
All you have to do is add another !bg line, calling your script to
notify you. Make it a script, don't stuff the command in there, it's
much easier to change later. For example:
demon:
!bg /usr/local/bin/notify-neil MYADDR
Note that if you're sending a message via email, you may have to
explicitly request a queue run at the end of the script to actually get
the message sent.
Hmmm, actually, this sort of thing looks like an ideal application for
jabber...
-Dom
More information about the Ukfreebsd
mailing list