Re: HELP -- System Time problem.

2001-01-03 Thread Luke C Gavel


su -c 'date -s "8:00am"'

-- Generated Signature --
Most general statements are false, 
including this one.
-- Alexander Dumas
-- End Sig --



___
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list



Re: HELP -- System Time problem.

2001-01-02 Thread John Aldrich

On Tue, 02 Jan 2001, Anthony E . Greene wrote:
> On Tue, 02 Jan 2001 20:05:36 John Aldrich wrote:
> >A good util is "rdate" to sync your pc clock with an atomic
> >clock over the 'Net. 
> 
> The only problem with rdate for non-realtime apps is that you have to jump
> through hoops to see if it failed. It _always_ gives an exit code of zero,
> no matter what errors occur.
> 
Hmm..it's never failed for me... it's had problems reaching
the server from time to time, but that's pretty obvious
with the "-s -p" options. :-)
John



___
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list



Re: Fun with rdate (was: HELP -- System Time problem.)

2001-01-02 Thread Hal Burgiss

On Tue, Jan 02, 2001 at 09:40:48PM -0500, Anthony E . Greene wrote:
> >
> >Just throwing some obvious errors at it, it does return 1 in limiting
> >testing. FWIW.
> 
> That blurb is in the version that shipped with RH6.2 and I have not found an
> error condition that results in a nonzero exit code. How did you do it?

Just some IPs that were not good or didn't have a time server:

[root@feenix /tmp]# rdate -p 192.168.10.22
rdate: couldn't connect to host 192.168.10.22: No route to host
[root@feenix /tmp]# echo $?
1

[root@feenix /tmp]# rdate -p 192.168.10.15
rdate: couldn't connect to host 192.168.10.15: Connection refused
[root@feenix /tmp]# echo $?
1

[root@feenix /tmp]# rdate -p 156.46.204.6 
rdate: couldn't connect to host 156.46.204.6: Connection timed out
[root@feenix /tmp]# echo $?
1

[root@feenix /tmp]# rdate -p gilbreth.ecn.purdue.edu
[gilbreth.ecn.purdue.edu]   Tue Jan  2 22:05:30 2001
[root@feenix /tmp]# echo $?
0


I can't think of a way to simulate a real world time server failure.
But my script for rdate has code very similar to yours, for the same
reasons.

-- 
Hal B
 [EMAIL PROTECTED]
 [EMAIL PROTECTED]
 [EMAIL PROTECTED]
--



___
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list



Re: Fun with rdate (was: HELP -- System Time problem.)

2001-01-02 Thread Anthony E . Greene

On Tue, 02 Jan 2001 21:28:01 Hal Burgiss wrote:
>On Tue, Jan 02, 2001 at 09:18:37PM -0500, Anthony E . Greene wrote:
>> The only problem with rdate for non-realtime apps is that you have
>> to jump through hoops to see if it failed. It _always_ gives an exit
>> code of zero, no matter what errors occur.
>
>I've run into this too, and have used a similar workaround. Just now
>checking the RH7 man page and was surprised to find:
>
>
>HISTORY
>   2000-02-04 Elliot Lee <[EMAIL PROTECTED]>
>   Wrote  it  (previous  incarnation had license probĀ­
>   lems, all 200 lines of it).
>
>Just throwing some obvious errors at it, it does return 1 in limiting
>testing. FWIW.

That blurb is in the version that shipped with RH6.2 and I have not found an
error condition that results in a nonzero exit code. How did you do it?

Tony
-- 
Anthony E. Greene <[EMAIL PROTECTED]> 
PGP Key: 0x6C94239D/7B3D BD7D 7D91 1B44 BA26  C484 A42A 60DD 6C94 239D
Chat:  AOL/Yahoo: TonyG05ICQ: 91183266
Linux. The choice of a GNU Generation. 



___
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list



Re: HELP -- System Time problem.

2001-01-02 Thread Hal Burgiss

On Tue, Jan 02, 2001 at 09:18:37PM -0500, Anthony E . Greene wrote:
> On Tue, 02 Jan 2001 20:05:36 John Aldrich wrote:
> >A good util is "rdate" to sync your pc clock with an atomic
> >clock over the 'Net. 
> 
> The only problem with rdate for non-realtime apps is that you have
> to jump through hoops to see if it failed. It _always_ gives an exit
> code of zero, no matter what errors occur.

I've run into this too, and have used a similar workaround. Just now
checking the RH7 man page and was surprised to find:


HISTORY
   2000-02-04 Elliot Lee <[EMAIL PROTECTED]>
   Wrote  it  (previous  incarnation had license probĀ­
   lems, all 200 lines of it).

Just throwing some obvious errors at it, it does return 1 in limiting
testing. FWIW.

-- 
Hal B
 [EMAIL PROTECTED]
 [EMAIL PROTECTED]
 [EMAIL PROTECTED]
--



___
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list



Re: HELP -- System Time problem.

2001-01-02 Thread Anthony E . Greene

On Tue, 02 Jan 2001 20:05:36 John Aldrich wrote:
>A good util is "rdate" to sync your pc clock with an atomic
>clock over the 'Net. 

The only problem with rdate for non-realtime apps is that you have to jump
through hoops to see if it failed. It _always_ gives an exit code of zero,
no matter what errors occur.

One workaround I saw was to redirect STDERR to a file and check for a
non-zero length file:

#!/bin/sh
#
# Specify the location/name of the temp file that will hold
# rdate's error messages (STDERR).
errorfile=/tmp/settime.$$

# Get the date/time and send any errors to the error file.
rdate time.nist.gov 2> $errorfile

# Put the error message(s) in a variable. If there were
# no errors, the file will still exist, but will be empty.
errmsg=`cat $errorfile`

# Remove the temp file.
rm -f $errorfile

# Check to see if there actually was an error message.
if [ -n "$errmsg" ] ; then
  echo 'rdate failed'
else
  echo 'rdate succeeded'
fi
# end of script


-- 
Anthony E. Greene <[EMAIL PROTECTED]> 
PGP Key: 0x6C94239D/7B3D BD7D 7D91 1B44 BA26  C484 A42A 60DD 6C94 239D
Chat:  AOL/Yahoo: TonyG05ICQ: 91183266
Linux. The choice of a GNU Generation. 



___
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list



Re: HELP -- System Time problem.

2001-01-02 Thread John Aldrich

On Tue, 02 Jan 2001, John N. Alegre wrote:
> I am running RedHat 6.1/6.2 on two towers and a Think Pad.  Both the towers
> switched the year just fine, but the laptop booted Monday morning with a date
> in 1999 and a time seven hours off.  I used the control-panel time machine and
> changed the date and time and selected "Set System Time".  
> 
> After I rebooted the date was correct but the time changes back to the incorrect
> 7 hours ahead.  I have tried a a few more times and the time does not hold past
> reboot.
> 
> Can anyone help?  Is there a way to set date from the command line?  Why would
> this only happen on the laptop?
> 
A good util is "rdate" to sync your pc clock with an atomic
clock over the 'Net. I use time.nist.gov or
tock.usno.navy.mil personally. The command I use is as
follows:
rdate -s -p 
The options are -s (SET the time) and -p (PRINT the time so
you know it's actually corrected! ) Then, as someone has
suggested later, as root, run hwclock --systohc.
John



___
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list



Re: HELP -- System Time problem.

2001-01-02 Thread Mike Burger

Your laptop's system clock is behind.  Once you set the time again, open
up a command prompt, and, as root, run "hwclock systohc" to set the
hardware clock.

On Tue, 2 Jan 2001, John N. Alegre wrote:

> I am running RedHat 6.1/6.2 on two towers and a Think Pad.  Both the towers
> switched the year just fine, but the laptop booted Monday morning with a date
> in 1999 and a time seven hours off.  I used the control-panel time machine and
> changed the date and time and selected "Set System Time".
>
> After I rebooted the date was correct but the time changes back to the incorrect
> 7 hours ahead.  I have tried a a few more times and the time does not hold past
> reboot.
>
> Can anyone help?  Is there a way to set date from the command line?  Why would
> this only happen on the laptop?
>
> All comments welcome.
> john
>
> --
> E-Mail: John N. Alegre <[EMAIL PROTECTED]>
> Date: 02-Jan-01
> Time: 18:48:49
>
> This message was sent by XFMail
> --
>
>
>
> ___
> Redhat-list mailing list
> [EMAIL PROTECTED]
> https://listman.redhat.com/mailman/listinfo/redhat-list
>



___
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list



HELP -- System Time problem.

2001-01-02 Thread John N. Alegre

I am running RedHat 6.1/6.2 on two towers and a Think Pad.  Both the towers
switched the year just fine, but the laptop booted Monday morning with a date
in 1999 and a time seven hours off.  I used the control-panel time machine and
changed the date and time and selected "Set System Time".  

After I rebooted the date was correct but the time changes back to the incorrect
7 hours ahead.  I have tried a a few more times and the time does not hold past
reboot.

Can anyone help?  Is there a way to set date from the command line?  Why would
this only happen on the laptop?

All comments welcome.
john

--
E-Mail: John N. Alegre <[EMAIL PROTECTED]>
Date: 02-Jan-01
Time: 18:48:49

This message was sent by XFMail
--



___
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list