From 772797a8e4d9b3db7f609d20e73a0e66805ba2f1 Mon Sep 17 00:00:00 2001 From: Johannes Wienke Date: Sat, 22 Feb 2025 14:52:47 +0100 Subject: [PATCH] feat(systemd): automatically enable/disable suspend hook Declares the autosuspend-detect-suspend.service in the Also section of the autosuspend systemd unit. That way, the suspend unit is enabled/disabled together with the main unit and users don't have to remember activating/deactivating this unit. Cf.: #625 --- data/autosuspend.service | 1 + doc/source/systemd_integration.rst | 5 ----- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/data/autosuspend.service b/data/autosuspend.service index 1ef7b5a1..817d292f 100644 --- a/data/autosuspend.service +++ b/data/autosuspend.service @@ -8,3 +8,4 @@ ExecStart=/usr/bin/autosuspend -l /etc/autosuspend-logging.conf daemon [Install] WantedBy=multi-user.target +Also=autosuspend-detect-suspend.service diff --git a/doc/source/systemd_integration.rst b/doc/source/systemd_integration.rst index d28ee0bc..19e7bd5f 100644 --- a/doc/source/systemd_integration.rst +++ b/doc/source/systemd_integration.rst @@ -19,11 +19,6 @@ To start |project_program| via `systemd`_, execute: .. code-block:: bash systemctl enable autosuspend.service - systemctl enable autosuspend-detect-suspend.service - -.. note:: - - Do not forget the second ``enable`` call to ensure that wake ups are configured even if the system is manually placed into suspend. To start |project_program| automatically at system start, execute: