| 1 | From 6cfd14ad6006b6e5818e4fb16cac5cb0c0b87f92 Mon Sep 17 00:00:00 2001
|
| 2 | From: Clayton Craft <[email protected]>
|
| 3 | Date: Wed, 27 May 2026 09:09:43 -0700
|
| 4 | Subject: [PATCH] alsactl: use [Install] instead of .wants/ symlinks for
|
| 5 | systemd integration
|
| 6 |
|
| 7 | This adds [Install] sections with WantedBy=sound.target to alsa-restore and
|
| 8 | alsa-state service files, and removes the install-data-hook that manually
|
| 9 | creates .wants/ symlinks. This lets distributions manage
|
| 10 | enabling/disabling via a preset policy rather than hardwiring it at
|
| 11 | install 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 |
|
| 18 | diff --git a/alsactl/Makefile.am b/alsactl/Makefile.am
|
| 19 | index c79213765..9e300e2da 100644
|
| 20 | |
| 21 | |
| 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 = \
|
| 37 | diff --git a/alsactl/conf/alsa-restore.service.in b/alsactl/conf/alsa-restore.service.in
|
| 38 | index 80fd5fd48..6a79e4375 100644
|
| 39 | |
| 40 | |
| 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
|
| 48 | diff --git a/alsactl/conf/alsa-state.service.in b/alsactl/conf/alsa-state.service.in
|
| 49 | index 5a8fe5eee..cc5901d52 100644
|
| 50 | |
| 51 | |
| 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
|