public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] Setting time in middle of session
@ 2006-02-16  7:10 acaudel
  2006-02-16  7:50 ` Uwe Thiem
  0 siblings, 1 reply; 6+ messages in thread
From: acaudel @ 2006-02-16  7:10 UTC (permalink / raw
  To: gentoo-user

I've had to temporarily switch to dial-up from a broadband connection
and of course /etc/init.d/ntp-client fails since a connection is not
available on boot-up.  I have tried manually executing this but it has
occurred to me that setting the time in the middle of a session may not
be a good idea.

Any thoughts?

If not, how should I set the time.  It has been awhile since it was set.

Tony
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [gentoo-user] Setting time in middle of session
  2006-02-16  7:10 [gentoo-user] Setting time in middle of session acaudel
@ 2006-02-16  7:50 ` Uwe Thiem
  2006-02-16 21:20   ` [gentoo-user] " James
  0 siblings, 1 reply; 6+ messages in thread
From: Uwe Thiem @ 2006-02-16  7:50 UTC (permalink / raw
  To: gentoo-user

On 16 February 2006 09:10, acaudel@gt.rr.com wrote:
> I've had to temporarily switch to dial-up from a broadband connection
> and of course /etc/init.d/ntp-client fails since a connection is not
> available on boot-up.  I have tried manually executing this but it has
> occurred to me that setting the time in the middle of a session may not
> be a good idea.
>
> Any thoughts?

With a dial-up connection, you haven't much chance other than connecting to a 
time server when your connection is up. I do it automatically 
in /etc/ppp/ip-up.

Uwe

-- 
Why do consumers keep buying products they will live to curse?
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 6+ messages in thread

* [gentoo-user]  Re: Setting time in middle of session
  2006-02-16  7:50 ` Uwe Thiem
@ 2006-02-16 21:20   ` James
  2006-02-17  7:11     ` Uwe Thiem
  0 siblings, 1 reply; 6+ messages in thread
From: James @ 2006-02-16 21:20 UTC (permalink / raw
  To: gentoo-user

Uwe Thiem <uwix <at> iway.na> writes:


> With a dial-up connection, you haven't much chance other than connecting to a 
> time server when your connection is up. I do it automatically 
> in /etc/ppp/ip-up.

Hey, this is cool, do you have an example 'ip-up' config file? I 
have used ppp quite a lot to talk to industrial equipment, so any
other examples of things you can fire up once a ppp link is 
established, is of keen interest to me....

Does this work with any ppp/ppp_dialer or just a specific one?
wvdial is what I have used, but, I'm open to kppp or any
other robust ppp tools, as I usually manually fire up software
manually once the link is established. Hopefully, this and other 
config files can exist simultaneously, as I need to routinely 
connect  with ppp to different closed( non internet) networks.... 
When I use PPP, it may be the primary link or used as a backup,
remote connection.

I also, I routinely establish ppp links, over RS232 serial ports, to
a variety of embedded system, so any other ppp ideas, config files
and code snippets are of keen interest likewise. Sometimes I just talk
to the embedded web server in a device over the ppp-serial link.

My oldest portable, was debian with all of the ppp tricks on it.
It died and I did not have a backup of my ppp tricks on my debian
system, one of which was settings that worked with a variety
of modems on cisco routers. Dam cisco and their s-register 
modem setting incompatibilities.... 


any information is appreciated,

James





-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [gentoo-user]  Re: Setting time in middle of session
  2006-02-16 21:20   ` [gentoo-user] " James
@ 2006-02-17  7:11     ` Uwe Thiem
  2006-02-17 13:32       ` James
  0 siblings, 1 reply; 6+ messages in thread
From: Uwe Thiem @ 2006-02-17  7:11 UTC (permalink / raw
  To: gentoo-user

On 16 February 2006 23:20, James wrote:
> Uwe Thiem <uwix <at> iway.na> writes:
> > With a dial-up connection, you haven't much chance other than connecting
> > to a time server when your connection is up. I do it automatically
> > in /etc/ppp/ip-up.
>
> Hey, this is cool, do you have an example 'ip-up' config file? I
> have used ppp quite a lot to talk to industrial equipment, so any
> other examples of things you can fire up once a ppp link is
> established, is of keen interest to me....
>
> Does this work with any ppp/ppp_dialer or just a specific one?
> wvdial is what I have used, but, I'm open to kppp or any
> other robust ppp tools, as I usually manually fire up software
> manually once the link is established. Hopefully, this and other
> config files can exist simultaneously, as I need to routinely
> connect  with ppp to different closed( non internet) networks....
> When I use PPP, it may be the primary link or used as a backup,
> remote connection.

It works with any dialer that uses pppd as back-end. As soon as the IP layer 
is up, the script /etc/ppp/ip-up gets called. You can put any command into it 
for which it makes sense to be executed when the connection is established.

My customised part of ip-up looks like this:

/sbin/shorewall start > /var/log/fw.start 2>%1
/etc/ppp/ntp
/usr/bin/fetchmail -f /etc/fetchmailrc
/usr/sbin/exim -qff

The first line starts my firewall. The second one calls another script that 
handles time synchronisation. The third one fetches my emails and the last 
one forces exim to send whatever is lying in its queue.

The script "ntp":

#! /bin/sh

/usr/sbin/ntpdate ntp.ipb.na > /dev/null 2>&1
RETURNCODE=$?

if [ "$RETURNCODE" = "0" ]; then
  /sbin/hwclock -u -w
fi


It synchronises with an ntp server nearby. On success, it writes the result to 
my hardware clock.

>
> I also, I routinely establish ppp links, over RS232 serial ports, to
> a variety of embedded system, so any other ppp ideas, config files
> and code snippets are of keen interest likewise. Sometimes I just talk
> to the embedded web server in a device over the ppp-serial link.

Doesn't matter whether it uses a modem, just a serial line or any other 
media, /etc/ppp/ip-up is executed as soon as the two ppp processes have 
established an IP connection.

When I wrote a book, I got paranoid about backups. So ip-up sent the current 
state of my manuscript to a server at a different physical location every 
time I went on-line. 

Uwe

-- 
Why do consumers keep buying products they will live to curse?
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 6+ messages in thread

* [gentoo-user]  Re: Setting time in middle of session
  2006-02-17  7:11     ` Uwe Thiem
@ 2006-02-17 13:32       ` James
  2006-02-17 14:24         ` Uwe Thiem
  0 siblings, 1 reply; 6+ messages in thread
From: James @ 2006-02-17 13:32 UTC (permalink / raw
  To: gentoo-user

Uwe Thiem <uwix <at> iway.na> writes:

> > Hey, this is cool, do you have an example 'ip-up' config file? 

> My customised part of ip-up looks like this:
<snip>

> Doesn't matter whether it uses a modem, just a serial line or any other 
> media, /etc/ppp/ip-up is executed as soon as the two ppp processes have 
> established an IP connection.

This is cool, I realized that I had not actually emerged ppp so that's
why /etc/ppp/ip-up was missing. Thanks for the examples, I should be
all set now.

thx,
James



-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [gentoo-user]  Re: Setting time in middle of session
  2006-02-17 13:32       ` James
@ 2006-02-17 14:24         ` Uwe Thiem
  0 siblings, 0 replies; 6+ messages in thread
From: Uwe Thiem @ 2006-02-17 14:24 UTC (permalink / raw
  To: gentoo-user

On 17 February 2006 15:32, James wrote:
> Uwe Thiem <uwix <at> iway.na> writes:
> > > Hey, this is cool, do you have an example 'ip-up' config file?
> >
> > My customised part of ip-up looks like this:
>
> <snip>
>
> > Doesn't matter whether it uses a modem, just a serial line or any other
> > media, /etc/ppp/ip-up is executed as soon as the two ppp processes have
> > established an IP connection.
>
> This is cool, I realized that I had not actually emerged ppp so that's
> why /etc/ppp/ip-up was missing. Thanks for the examples, I should be
> all set now.

Actually, I forgot something. You said you used ppp for connections to 
embedded devices not on the Internet. So you probably want to do different 
things depending on which device you connect to.

Since the fifth parameter ($5) ip-ip gets called with is the remote IP address 
you can base on that parameter which part of ip-up is executed.

Uwe

-- 
Why do consumers keep buying products they will live to curse?
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2006-02-17 14:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-16  7:10 [gentoo-user] Setting time in middle of session acaudel
2006-02-16  7:50 ` Uwe Thiem
2006-02-16 21:20   ` [gentoo-user] " James
2006-02-17  7:11     ` Uwe Thiem
2006-02-17 13:32       ` James
2006-02-17 14:24         ` Uwe Thiem

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox