]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
Merge pull request #17693 from yuwata/tmpfiles-compress-nocow-on-btrfs
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 18 Dec 2020 07:52:29 +0000 (16:52 +0900)
committerGitHub <noreply@github.com>
Fri, 18 Dec 2020 07:52:29 +0000 (16:52 +0900)
tmpfiles: try to set file attributes one by one

man/systemd.timer.xml
src/basic/special.h
src/core/timer.c
units/systemd-timesyncd.service.in

index 9fe7ff3255cffd4064d3c66f305942d64f5c7baa..84c5bb564cc0a316bfbc4a0a69453e7e29be6296 100644 (file)
         units involved with early boot or late system shutdown should disable the
         <varname>DefaultDependencies=</varname> option.</para></listitem>
 
-        <listitem><para>Timer units
-        with at least one <varname>OnCalendar=</varname> directive will have an additional <varname>After=</varname>
-        dependency on <filename>time-sync.target</filename> to avoid being started before the system clock has been
-        correctly set.</para></listitem>
+        <listitem><para>Timer units with at least one <varname>OnCalendar=</varname> directive acquire a pair
+        of additional <varname>After=</varname> dependencies on <filename>time-set.target</filename> and
+        <filename>time-sync.target</filename>, in order to avoid being started before the system clock has
+        been correctly set. See
+        <citerefentry><refentrytitle>systemd.special</refentrytitle><manvolnum>7</manvolnum></citerefentry>
+        for details on these two targets.</para></listitem>
       </itemizedlist>
     </refsect2>
   </refsect1>
index d55b3289dee184ae97f9e4002e826706c53f6fc3..b9b7be7a7dda98c0b0840bacabcda882c75ed150 100644 (file)
@@ -42,6 +42,7 @@
 #define SPECIAL_SWAP_TARGET "swap.target"
 #define SPECIAL_NETWORK_ONLINE_TARGET "network-online.target"
 #define SPECIAL_TIME_SYNC_TARGET "time-sync.target"       /* LSB's $time */
+#define SPECIAL_TIME_SET_TARGET "time-set.target"
 #define SPECIAL_BASIC_TARGET "basic.target"
 
 /* LSB compatibility */
index f42c86da765f3e21d4d63d8f3a6fca11bfdb130a..32abdb74d76c52abdff304864da205cd31864dde 100644 (file)
@@ -99,13 +99,20 @@ static int timer_add_default_dependencies(Timer *t) {
                 if (r < 0)
                         return r;
 
-                LIST_FOREACH(value, v, t->values)
-                        if (v->base == TIMER_CALENDAR) {
-                                r = unit_add_dependency_by_name(UNIT(t), UNIT_AFTER, SPECIAL_TIME_SYNC_TARGET, true, UNIT_DEPENDENCY_DEFAULT);
+                LIST_FOREACH(value, v, t->values) {
+                        const char *target;
+
+                        if (v->base != TIMER_CALENDAR)
+                                continue;
+
+                        FOREACH_STRING(target, SPECIAL_TIME_SYNC_TARGET, SPECIAL_TIME_SET_TARGET) {
+                                r = unit_add_dependency_by_name(UNIT(t), UNIT_AFTER, target, true, UNIT_DEPENDENCY_DEFAULT);
                                 if (r < 0)
                                         return r;
-                                break;
                         }
+
+                        break;
+                }
         }
 
         return unit_add_two_dependencies_by_name(UNIT(t), UNIT_BEFORE, UNIT_CONFLICTS, SPECIAL_SHUTDOWN_TARGET, true, UNIT_DEPENDENCY_DEFAULT);
index 62120d819088329bdb0ca10058dee12934caea6f..c0d63f5c708ce205e0a3e4be4a5e6506cedc1161 100644 (file)
@@ -16,7 +16,7 @@ DefaultDependencies=no
 After=systemd-sysusers.service
 Before=time-set.target sysinit.target shutdown.target
 Conflicts=shutdown.target
-Wants=time-set.target time-sync.target
+Wants=time-set.target
 
 [Service]
 AmbientCapabilities=CAP_SYS_TIME