Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Kello oikeaan aikaan? [solved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Finnish
View previous topic :: View next topic  
Author Message
Lonne
n00b
n00b


Joined: 12 Dec 2004
Posts: 31
Location: Joensuu, Finland

PostPosted: Mon Feb 21, 2005 7:37 pm    Post subject: Kello oikeaan aikaan? [solved] Reply with quote

kuinka saan Gentoo linuxin pitämään koneeni kellon ajassaan, siis suomen ajassa? emoni kello jää jälkeen, kun kone ei ole päällä (noin vartin yössä), joten olisi mukava saada kello oikeaan aikaan, kun laitan koneen päälle. mikä ohjelma tarvitaan ja mitä tiedostoja pitää muokata? ihan pihalla=)

Last edited by Lonne on Tue Feb 22, 2005 8:57 am; edited 1 time in total
Back to top
View user's profile Send private message
Obi-Lan
Apprentice
Apprentice


Joined: 21 Jan 2005
Posts: 230
Location: Riihimäki

PostPosted: Mon Feb 21, 2005 8:08 pm    Post subject: Reply with quote

Ainoa vaihtoehto lienee se, että kone joka bootissa hakee oikean ajan joltain aikapalvelimelta. Ei ole tarkkaa tietoa tosin miten toteuttaa, liekö tosta apua: http://blog.subverted.net/index.php?p=12
Back to top
View user's profile Send private message
huijar
n00b
n00b


Joined: 03 Feb 2005
Posts: 10

PostPosted: Mon Feb 21, 2005 8:11 pm    Post subject: Reply with quote

http://forums.gentoo.org/viewtopic.php?t=41099
Back to top
View user's profile Send private message
Zarhan
l33t
l33t


Joined: 27 Feb 2004
Posts: 920

PostPosted: Mon Feb 21, 2005 10:09 pm    Post subject: Reply with quote

Ohjeet on jo linkissä, mutta pikaisesti:

Code:

emerge ntp


Tämä asentaa rc-updatella käytettäviksi kaksi ohjelmaa, ntp-clientin ja ntpd:n. Ntp-client on sitä varten että kello vain asetetaan bootissa verkosta, ntpd sellainen että se hakee ajan verkosta vähän väliä (alussa useammin, myöhemmin harvemmin, enimmillään puolen tunnin välein) ja pitää kirjaa siitä paljonko kellosi edistää/jätättää - joten kello pysyy ajassa offlinenäkin.

Nopea ratkaisu: Säädä /etc/conf.d/ntp-client-tiedostoon aikapalvelin ja laita ntp-client käynnistymään. Näin siis ajan asetus bootissa.

Hitaampi mutta parempi ratkaisu (eli kello pysyy ajassa vaikka kone on päällä pitkäänkin): Älä laita ntp-clienttiä, vaan väkerrä oma ntp.conf-tiedosto. Sudenkuopat: Jos käytät dhcp:tä, aseta /etc/conf.d/net-tiedostoon dhcp-optioihin "-N" - muuten dhcpcd ylikirjoittaa ntp.conffisi.

/etc/ntp.confin sisällöksi seuraavaa - paitsi että laita ntp.inet.fi:n (Sonera) tilalle oma palvelimesi.

Hieroglyfit merkkaavat sitä että server sanoo palvelimen miltä aika haetaan (voi listata useita, jolloin prefer kertoo että tätä suositaan ensisijaisesti). Drift säilöö sen koneen kellon käyttäytymisen, ja restrict-optioilla estetään loppua internetiä kyselemästä sinulta aikaa mutta sallitaan ntp.inet.fi:n sitä muuttaa. Huomaa että (jokainen) aikapalvelin listataan siis kahdesti - sekä server-rivillä että restrict-rivillä.

Code:

# NOTES:
#  - you should only have to update the server line below
#  - if you start getting lines like 'restrict' and 'fudge'
#    and you didnt add them, AND you run dhcpcd on your
#    network interfaces, be sure to add '-Y -N' to the
#    dhcpcd_ethX variables in /etc/conf.d/net

# Name of the servers ntpd should sync with
# Please respect the access policy as stated by the responsible person.
#server         ntp.example.tld         iburst
server ntp.inet.fi prefer

##
# A list of available servers is available here:
# http://www.eecis.udel.edu/~mills/ntp/clock2a.html
# http://www.eecis.udel.edu/~mills/ntp/servers.html
# Please follow the rules of engagement and use a
# Stratum 2 server (unless you qualify for Stratum 1)
##

# you should not need to modify the following paths
logfile         /var/log/ntpd.log
driftfile       /var/lib/ntp/ntp.drift

#server ntplocal.example.com prefer
#server timeserver.example.org

# Warning: Using default NTP settings will leave your NTP
# server accessible to all hosts on the Internet.

# If you want to deny all machines (including your own)
# from accessing the NTP server, uncomment:
#
restrict default ignore

# To only deny other machines from changing the
# configuration but allow localhost uncomment:
#
#restrict default nomodify noserve nopeer noquery
restrict 127.0.0.1 nopeer

# To allow machines within your network to synchronize
# their clocks with your server, but ensure they are
# not allowed to configure the server or used as peers
# to synchronize against, uncomment this line.
#
#restrict 192.168.1.0 mask 255.255.255.0 notrust nomodify notrap
restrict ntp.inet.fi nomodify


Have fun. Eli kun file on sisällä niin rc-update add ntp default vaan..

Kun ntpd on käynnissä, voit seurata toimintaa kirjoittamalla

Code:
ntpq -p
Back to top
View user's profile Send private message
Lonne
n00b
n00b


Joined: 12 Dec 2004
Posts: 31
Location: Joensuu, Finland

PostPosted: Tue Feb 22, 2005 9:03 am    Post subject: TODI! =) Reply with quote

Vähän meni säätämiseks ensin, mutta sainpahan toimimaan ja kellon aikaan. käytän tick.keso.fi palvelinta, viive on aika pieni.
jeah tack för all igen...
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Finnish All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum