From 778b6a3f8888ec9496143c92c8cbf95f5c891df9 Mon Sep 17 00:00:00 2001 From: Josh Triplett Date: Sat, 29 Nov 2014 01:06:28 -0800 Subject: [PATCH] systemd-sleep: Support sleep.conf.d directories in the usual search paths --- Makefile-man.am | 5 +++++ man/systemd-sleep.conf.xml | 15 ++++++++++++--- man/systemd-suspend.service.xml | 3 ++- src/shared/sleep-config.c | 7 ++++--- 4 files changed, 23 insertions(+), 7 deletions(-) diff --git a/Makefile-man.am b/Makefile-man.am index e0c15fa39..2a0d73e05 100644 --- a/Makefile-man.am +++ b/Makefile-man.am @@ -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) diff --git a/man/systemd-sleep.conf.xml b/man/systemd-sleep.conf.xml index d72496067..99e0e3315 100644 --- a/man/systemd-sleep.conf.xml +++ b/man/systemd-sleep.conf.xml @@ -22,7 +22,8 @@ You should have received a copy of the GNU Lesser General Public License along with systemd; If not, see . --> - + systemd-sleep.conf systemd @@ -44,11 +45,15 @@ along with systemd; If not, see . systemd-sleep.conf + sleep.conf.d Suspend and hibernation configuration file /etc/systemd/sleep.conf + /etc/systemd/sleep.conf.d/*.conf + /run/systemd/sleep.conf.d/*.conf + /usr/lib/systemd/sleep.conf.d/*.conf @@ -98,7 +103,7 @@ along with systemd; If not, see . - Settings in this file determine what strings + Settings in these files determine what strings will be written to /sys/power/disk and /sys/power/state by @@ -108,12 +113,16 @@ along with systemd; If not, see . attempts to suspend or hibernate the machine. + + + Options The following options can be configured in the [Sleep] section of - /etc/systemd/sleep.conf: + /etc/systemd/sleep.conf or a + sleep.conf.d file: diff --git a/man/systemd-suspend.service.xml b/man/systemd-suspend.service.xml index 9a3ae1b89..375c25576 100644 --- a/man/systemd-suspend.service.xml +++ b/man/systemd-suspend.service.xml @@ -114,7 +114,8 @@ /sys/power/state, to trigger the actual system suspend. What exactly is written where can be configured in the [Sleep] - section of /etc/systemd/sleep.conf. + section of /etc/systemd/sleep.conf or a + sleep.conf.d file. See systemd-sleep.conf5. diff --git a/src/shared/sleep-config.c b/src/shared/sleep-config.c index 0fd307d0b..ae14c6bd4 100644 --- a/src/shared/sleep-config.c +++ b/src/shared/sleep-config.c @@ -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 */ -- 2.30.2