[systemd-commits] 2 commits - Makefile.am TODO src/timedate

Lennart Poettering lennart at kemper.freedesktop.org
Mon Jul 2 17:02:39 PDT 2012


 Makefile.am              |    4 ---
 TODO                     |    2 +
 src/timedate/ntp-units   |    4 ---
 src/timedate/timedated.c |   59 +++++++++++++++++++++++++++++------------------
 4 files changed, 39 insertions(+), 30 deletions(-)

New commits:
commit d1970645411ea1cc083ea1668e0d446252dc1505
Author: Lennart Poettering <lennart at poettering.net>
Date:   Tue Jul 3 02:01:56 2012 +0200

    update TODO

diff --git a/TODO b/TODO
index ce0b050..56798a5 100644
--- a/TODO
+++ b/TODO
@@ -22,6 +22,8 @@ Bugfixes:
 
 Features:
 
+* journald: we currently rotate only after MaxUse+MaxFilesize has been reached.
+
 * reexec journald across initrd transition
 
 * nspawn: bind mount /var/log/journal from the host

commit b32d167503b0d98f6b612fda768f92f3aad0ad0c
Author: Lennart Poettering <lennart at poettering.net>
Date:   Tue Jul 3 02:00:05 2012 +0200

    timedated: replace ntp-units file with an ntp-units.d drop-in dir
    
    To be considered by timedated for NTP a package simply has to drop in
    /usr/lib/systemd/ntp-units.d/foobar.list and write one or more unit
    names into it. The first one listed is the one that is enabled.

diff --git a/Makefile.am b/Makefile.am
index 1cfbf40..3b7ec0b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -133,7 +133,6 @@ AM_CPPFLAGS = \
 	-DSYSTEM_SHUTDOWN_PATH=\"$(systemshutdowndir)\" \
 	-DSYSTEM_SLEEP_PATH=\"$(systemsleepdir)\" \
 	-DSYSTEMD_KBD_MODEL_MAP=\"$(pkgdatadir)/kbd-model-map\" \
-	-DSYSTEMD_NTP_UNITS=\"$(pkgdatadir)/ntp-units\" \
 	-DX_SERVER=\"$(bindir)/X\" \
 	-DUDEVLIBEXECDIR=\"$(udevlibexecdir)\" \
 	-DPOLKIT_AGENT_BINARY_PATH=\"$(bindir)/pkttyagent\" \
@@ -2802,9 +2801,6 @@ timedated-install-data-hook:
 INSTALL_DATA_HOOKS += \
 	timedated-install-data-hook
 
-dist_pkgdata_DATA += \
-	src/timedate/ntp-units
-
 MANPAGES += \
 	man/systemd-timedated.service.8
 
diff --git a/src/timedate/ntp-units b/src/timedate/ntp-units
deleted file mode 100644
index 2a46f66..0000000
--- a/src/timedate/ntp-units
+++ /dev/null
@@ -1,4 +0,0 @@
-# NTP service implementations, in order of preference
-
-chronyd.service
-ntpd.service
diff --git a/src/timedate/timedated.c b/src/timedate/timedated.c
index 4be7c3a..5387699 100644
--- a/src/timedate/timedated.c
+++ b/src/timedate/timedated.c
@@ -31,6 +31,7 @@
 #include "polkit.h"
 #include "def.h"
 #include "hwclock.h"
+#include "conf-files.h"
 
 #define NULL_ADJTIME_UTC "0.0 0 0\n0\nUTC\n"
 #define NULL_ADJTIME_LOCAL "0.0 0 0\n0\nLOCAL\n"
@@ -304,40 +305,54 @@ static int write_data_local_rtc(void) {
 }
 
 static char** get_ntp_services(void) {
-        char **r = NULL;
-        FILE *f;
-
-        f = fopen(SYSTEMD_NTP_UNITS, "re");
-        if (!f)
+        char **r = NULL, **files, **i;
+        int k;
+
+        k = conf_files_list(&files, ".list",
+                            "/etc/systemd/ntp-units.d",
+                            "/run/systemd/ntp-units.d",
+                            "/usr/local/lib/systemd/ntp-units.d",
+                            "/usr/lib/systemd/ntp-units.d",
+                            NULL);
+        if (k < 0)
                 return NULL;
 
-        for (;;) {
-                char line[PATH_MAX], *l, **q;
+        STRV_FOREACH(i, files) {
+                FILE *f;
 
-                if (!fgets(line, sizeof(line), f)) {
+                f = fopen(*i, "re");
+                if (!f)
+                        continue;
 
-                        if (ferror(f))
-                                log_error("Failed to read NTP units file: %m");
+                for (;;) {
+                        char line[PATH_MAX], *l, **q;
 
-                        break;
-                }
+                        if (!fgets(line, sizeof(line), f)) {
 
-                l = strstrip(line);
-                if (l[0] == 0 || l[0] == '#')
-                        continue;
+                                if (ferror(f))
+                                        log_error("Failed to read NTP units file: %m");
 
+                                break;
+                        }
 
-                q = strv_append(r, l);
-                if (!q) {
-                        log_error("Out of memory");
-                        break;
+                        l = strstrip(line);
+                        if (l[0] == 0 || l[0] == '#')
+                                continue;
+
+                        q = strv_append(r, l);
+                        if (!q) {
+                                log_error("Out of memory");
+                                break;
+                        }
+
+                        strv_free(r);
+                        r = q;
                 }
 
-                strv_free(r);
-                r = q;
+                fclose(f);
         }
 
-        fclose(f);
+        strv_free(files);
 
         return r;
 }



More information about the systemd-commits mailing list