Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[systemd] What NTP service to use
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
WvR
Tux's lil' helper
Tux's lil' helper


Joined: 03 Mar 2011
Posts: 135
Location: Tsuruga, Japan

PostPosted: Tue Aug 27, 2013 10:58 am    Post subject: [systemd] What NTP service to use Reply with quote

I recently upgraded to Gnome-3.8 and systemd. It seems that systemd works, but there are a few details to take care of. One of these details is how to get automatic & continuous time & data setting with NTP. Previously, I used ntp-client (at startup) and then ntpd while the computer was running. I tried to use these with systemd, but it seems there are no services for systemd. I tried several ways:
Code:
 systemctl enable ntp
(does not work),
Code:
 systemctl enable ntpd
(does not work),
Code:
 systemctl enable ntpdate
(does not work),
Code:
 systemctl enable ntp-client
(does not work).

After some Googling, I found that maybe I should use
Code:
chronyd
, so I installed that. However, when I issue

Code:
 systemctl enable chrony


there is no error, but the chronyd service is listed as FAILED. When I start chronyd by hand, it works fine. I don't understand why it does not work with systemd but I could not find any usable debug info. So.... what can I use to set the time & date automatically and have continuous synchronization with NTP, if I use systemd?
Back to top
View user's profile Send private message
azp
Guru
Guru


Joined: 16 Nov 2003
Posts: 336
Location: Stockholm, Sweden

PostPosted: Thu Sep 05, 2013 9:34 pm    Post subject: Reply with quote

I have a service called ntp-client.service, which starts and tries to set the time. But it doesn't quite work:

Code:
root@skare$ systemctl status ntp-client.service
ntp-client.service - Set time via NTP
   Loaded: loaded (/usr/lib64/systemd/system/ntp-client.service; enabled)
   Active: failed (Result: exit-code) since tor 2013-09-05 23:08:29 CEST; 20min ago
  Process: 445 ExecStart=/usr/sbin/ntpdate $NTPCLIENT_OPTS (code=exited, status=1/FAILURE)
 Main PID: 445 (code=exited, status=1/FAILURE)
   CGroup: /system.slice/ntp-client.service

sep 05 23:08:29 skare ntpdate[445]: 5 Sep 23:08:29 ntpdate[445]: no servers can be used, exiting
sep 05 23:08:29 skare systemd[1]: ntp-client.service: main process exited, code=exited, status=1/FAILURE
sep 05 23:08:29 skare systemd[1]: Failed to start Set time via NTP.
sep 05 23:08:29 skare systemd[1]: Unit ntp-client.service entered failed state.


and the log says:

Code:
sep 05 23:30:17 skare systemd[1]: Starting Set time via NTP...
-- Subject: Unit ntp-client.service has begun with start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit ntp-client.service has begun starting up.
sep 05 23:30:17 skare systemd[1]: Ignoring invalid environment 'NTPCLIENT_OPTS=-s -b -u         0.gentoo.pool.ntp.org 1.gentoo.pool.ntp.org         2.gentoo.pool.ntp.org 3.gentoo.pool.ntp.org': /etc/conf.d/ntp-client
sep 05 23:30:17 skare ntpdate[25340]: 5 Sep 23:30:17 ntpdate[25340]: no servers can be used, exiting
sep 05 23:30:17 skare systemd[1]: ntp-client.service: main process exited, code=exited, status=1/FAILURE
sep 05 23:30:17 skare systemd[1]: Failed to start Set time via NTP.


So I'm not quite sure what to do about that. I guess the settings are b0rked and it needs to be ported to work with systemd.

By the way, I really recommend enabling bash completion, that lets you write 'systemctl enable' and then press tab to see all available services. No need to guess anymore :)
_________________
Weeks of coding can save you hours of planning.
Back to top
View user's profile Send private message
loading...
n00b
n00b


Joined: 11 Feb 2004
Posts: 19

PostPosted: Sat Oct 19, 2013 9:26 pm    Post subject: ntpdate Reply with quote

As I am on a desktop system which is only turned on once a day, I use ntpdate which is part of net-misc/ntp.

The net-misc/ntp installs as well a ntpdate.service file for systemd. You can easily activate it by passing a "systemctl enable ntpdate.service".
Back to top
View user's profile Send private message
croutch
n00b
n00b


Joined: 04 Aug 2012
Posts: 31
Location: göteborg

PostPosted: Sun Oct 20, 2013 2:38 am    Post subject: Reply with quote

Take a look there.

http://wiki.gentoo.org/wiki/System_time

https://wiki.archlinux.org/index.php/time
Back to top
View user's profile Send private message
ulenrich
Veteran
Veteran


Joined: 10 Oct 2010
Posts: 1122

PostPosted: Fri Dec 06, 2013 11:22 am    Post subject: Reply with quote

@WvR , I learned from another thread your issue might be more basic systemd related:
As root user having to configure localtime with systemd you should have a look at output of :
Code:
 $ timedatectl
# if not the timezone you want in the first line, list possibilities:
 $ timedatectl list-timezones
# shows how to configure:
 $ man timedatectl

At the end you should have something like me for germany:
Code:
 $ vdir /etc/localtime
lrwxrwxrwx 1 root root 33 19. Nov 14:37 /etc/localtime -> /usr/share/zoneinfo/Europe/Berlin

_________________
fun2gen2
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security 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