projects/aports·blob master · refs

58 lines · 2.1 KiB

1From 6cfd14ad6006b6e5818e4fb16cac5cb0c0b87f92 Mon Sep 17 00:00:00 2001
2From: Clayton Craft <[email protected]>
3Date: Wed, 27 May 2026 09:09:43 -0700
4Subject: [PATCH] alsactl: use [Install] instead of .wants/ symlinks for
5 systemd integration
6
7This adds [Install] sections with WantedBy=sound.target to alsa-restore and
8alsa-state service files, and removes the install-data-hook that manually
9creates .wants/ symlinks. This lets distributions manage
10enabling/disabling via a preset policy rather than hardwiring it at
11install time.
12---
13 alsactl/Makefile.am | 8 --------
14 alsactl/conf/alsa-restore.service.in | 3 +++
15 alsactl/conf/alsa-state.service.in | 3 +++
16 3 files changed, 6 insertions(+), 8 deletions(-)
17
18diff --git a/alsactl/Makefile.am b/alsactl/Makefile.am
19index c79213765..9e300e2da 100644
20--- a/alsactl/Makefile.am
21+++ b/alsactl/Makefile.am
22@@ -34,14 +34,6 @@ systemdsystemunit_DATA = \
23 conf/alsa-restore.service \
24 conf/[email protected]
25
26-install-data-hook:
27- $(MKDIR_P) -m 0755 \
28- $(DESTDIR)$(systemdsystemunitdir)/sound.target.wants
29- ( cd $(DESTDIR)$(systemdsystemunitdir)/sound.target.wants && \
30- rm -f alsa-state.service alsa-restore.service && \
31- $(LN_S) ../alsa-state.service alsa-state.service && \
32- $(LN_S) ../alsa-restore.service alsa-restore.service)
33-
34 endif
35
36 edit = \
37diff --git a/alsactl/conf/alsa-restore.service.in b/alsactl/conf/alsa-restore.service.in
38index 80fd5fd48..6a79e4375 100644
39--- a/alsactl/conf/alsa-restore.service.in
40+++ b/alsactl/conf/alsa-restore.service.in
41@@ -13,3 +13,6 @@ Type=oneshot
42 RemainAfterExit=true
43 ExecStart=-@sbindir@/alsactl restore
44 ExecStop=-@sbindir@/alsactl store
45+
46+[Install]
47+WantedBy=sound.target
48diff --git a/alsactl/conf/alsa-state.service.in b/alsactl/conf/alsa-state.service.in
49index 5a8fe5eee..cc5901d52 100644
50--- a/alsactl/conf/alsa-state.service.in
51+++ b/alsactl/conf/alsa-state.service.in
52@@ -11,3 +11,6 @@ ConditionPathExists=@daemonswitch@
53 Type=simple
54 ExecStart=-@sbindir@/alsactl -s -n 19 -c rdaemon
55 ExecStop=-@sbindir@/alsactl -s kill save_and_quit
56+
57+[Install]
58+WantedBy=sound.target