On Sun, 27 May 2001, Emmanuel Amador wrote:
..
> On the advice of Linux guru Alex Ibrado, I downloaded xntpd3-5 and
> began using it a few days ago. He showed me how to set it up so that
> it runs ntpdate and setclock whenever I go online.
> 
> Question: since the script is in /etc/ppp/ip-up.local, do I have to be
> root to get it to run whenever i log on?


I have an alternative (IMAO better) solution for nonpersistent links. I
run a little cron job (owned by root) every X minutes (your choice). It
goes something like this:

---
#!/usr/bin/perl
my $ret = `/sbin/ifconfig`;

if ($ret =~ /ppp[0-9]/) {
  system ("/opt/sbin/ntpdate clock.isc.org");
  system ("/sbin/hwclock --systohc");
}
exit;
---

You can prolly do something similar, even add some Perl IO::Socket stuff
to check if the connection is actually up before running ntpdate. You
could also add a (Perl) signal handler to alarm on ntpdate if it's taking
too long (which happens when the connection is down).



-- 
Orlando Andico <[EMAIL PROTECTED]>
Mosaic Communications, Inc.

-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GE d(-) s: a-25 C++++ UBLSI++++$ P+++ L+++>++++ E- W++ N(+)
o K? w O-- M- !V PS(++) PE- Y PGP-- t(+)@ 5(+) X++@ R(+) tv@
b++ DI++ G e++@ h--(*) r% y+
------END GEEK CODE BLOCK------

_
Philippine Linux Users Group. Web site and archives at http://plug.linux.org.ph
To leave: send "unsubscribe" in the body to [EMAIL PROTECTED]

To subscribe to the Linux Newbies' List: send "subscribe" in the body to 
[EMAIL PROTECTED]

Reply via email to