chiark / gitweb /
systemd-sleep: Support sleep.conf.d directories in the usual search paths
authorJosh Triplett <josh@joshtriplett.org>
Sat, 29 Nov 2014 09:06:28 +0000 (01:06 -0800)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sat, 29 Nov 2014 18:55:31 +0000 (13:55 -0500)
Makefile-man.am
man/systemd-sleep.conf.xml
man/systemd-suspend.service.xml
src/shared/sleep-config.c

index e0c15fa..2a0d73e 100644 (file)
@@ -196,6 +196,7 @@ MANPAGES_ALIAS += \
        man/sd_journal_wait.3 \
        man/sd_machine_get_ifindices.3 \
        man/sd_notifyf.3 \
+       man/sleep.conf.d.5 \
        man/system.conf.d.5 \
        man/systemd-ask-password-console.path.8 \
        man/systemd-ask-password-wall.path.8 \
@@ -305,6 +306,7 @@ man/sd_journal_test_cursor.3: man/sd_journal_get_cursor.3
 man/sd_journal_wait.3: man/sd_journal_get_fd.3
 man/sd_machine_get_ifindices.3: man/sd_machine_get_class.3
 man/sd_notifyf.3: man/sd_notify.3
+man/sleep.conf.d.5: man/systemd-sleep.conf.5
 man/system.conf.d.5: man/systemd-system.conf.5
 man/systemd-ask-password-console.path.8: man/systemd-ask-password-console.service.8
 man/systemd-ask-password-wall.path.8: man/systemd-ask-password-console.service.8
@@ -562,6 +564,9 @@ man/sd_machine_get_ifindices.html: man/sd_machine_get_class.html
 man/sd_notifyf.html: man/sd_notify.html
        $(html-alias)
 
+man/sleep.conf.d.html: man/systemd-sleep.conf.html
+       $(html-alias)
+
 man/system.conf.d.html: man/systemd-system.conf.html
        $(html-alias)
 
index d724960..99e0e33 100644 (file)
@@ -22,7 +22,8 @@ You should have received a copy of the GNU Lesser General Public License
 along with systemd; If not, see <http://www.gnu.org/licenses/>.
 -->
 
-<refentry id="systemd-sleep.conf">
+<refentry id="systemd-sleep.conf"
+          xmlns:xi="http://www.w3.org/2001/XInclude">
   <refentryinfo>
     <title>systemd-sleep.conf</title>
     <productname>systemd</productname>
@@ -44,11 +45,15 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>.
 
   <refnamediv>
     <refname>systemd-sleep.conf</refname>
+    <refname>sleep.conf.d</refname>
     <refpurpose>Suspend and hibernation configuration file</refpurpose>
   </refnamediv>
 
   <refsynopsisdiv>
     <para><filename>/etc/systemd/sleep.conf</filename></para>
+    <para><filename>/etc/systemd/sleep.conf.d/*.conf</filename></para>
+    <para><filename>/run/systemd/sleep.conf.d/*.conf</filename></para>
+    <para><filename>/usr/lib/systemd/sleep.conf.d/*.conf</filename></para>
   </refsynopsisdiv>
 
   <refsect1>
@@ -98,7 +103,7 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>.
       </varlistentry>
     </variablelist>
 
-    <para>Settings in this file determine what strings
+    <para>Settings in these files determine what strings
     will be written to
     <filename>/sys/power/disk</filename> and
     <filename>/sys/power/state</filename> by
@@ -108,12 +113,16 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>.
     attempts to suspend or hibernate the machine.</para>
   </refsect1>
 
+  <xi:include href="standard-conf.xml" xpointer="confd" />
+  <xi:include href="standard-conf.xml" xpointer="conf" />
+
   <refsect1>
     <title>Options</title>
 
     <para>The following options can be configured in the
     <literal>[Sleep]</literal> section of
-    <filename>/etc/systemd/sleep.conf</filename>:</para>
+    <filename>/etc/systemd/sleep.conf</filename> or a
+    <filename>sleep.conf.d</filename> file:</para>
 
     <variablelist class='systemd-directives'>
       <varlistentry>
index 9a3ae1b..375c255 100644 (file)
                 <filename>/sys/power/state</filename>, to trigger the
                 actual system suspend. What exactly is written
                 where can be configured in the <literal>[Sleep]</literal>
-                section of <filename>/etc/systemd/sleep.conf</filename>.
+                section of <filename>/etc/systemd/sleep.conf</filename> or a
+                <filename>sleep.conf.d</filename> file.
                 See <citerefentry><refentrytitle>systemd-sleep.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
                 </para>
         </refsect1>
index 0fd307d..ae14c6b 100644 (file)
@@ -48,9 +48,10 @@ int parse_sleep_config(const char *verb, char ***_modes, char ***_states) {
                 {}
         };
 
-        config_parse(NULL, PKGSYSCONFDIR "/sleep.conf", NULL,
-                     "Sleep\0",
-                     config_item_table_lookup, items, false, false, true, NULL);
+        config_parse_many(PKGSYSCONFDIR "/sleep.conf",
+                          CONF_DIRS_NULSTR("systemd/sleep.conf"),
+                          "Sleep\0", config_item_table_lookup, items,
+                          false, NULL);
 
         if (streq(verb, "suspend")) {
                 /* empty by default */