From 6cfd14ad6006b6e5818e4fb16cac5cb0c0b87f92 Mon Sep 17 00:00:00 2001 From: Clayton Craft Date: Wed, 27 May 2026 09:09:43 -0700 Subject: [PATCH] alsactl: use [Install] instead of .wants/ symlinks for systemd integration This adds [Install] sections with WantedBy=sound.target to alsa-restore and alsa-state service files, and removes the install-data-hook that manually creates .wants/ symlinks. This lets distributions manage enabling/disabling via a preset policy rather than hardwiring it at install time. --- alsactl/Makefile.am | 8 -------- alsactl/conf/alsa-restore.service.in | 3 +++ alsactl/conf/alsa-state.service.in | 3 +++ 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/alsactl/Makefile.am b/alsactl/Makefile.am index c79213765..9e300e2da 100644 --- a/alsactl/Makefile.am +++ b/alsactl/Makefile.am @@ -34,14 +34,6 @@ systemdsystemunit_DATA = \ conf/alsa-restore.service \ conf/alsa-card-wait@.service -install-data-hook: - $(MKDIR_P) -m 0755 \ - $(DESTDIR)$(systemdsystemunitdir)/sound.target.wants - ( cd $(DESTDIR)$(systemdsystemunitdir)/sound.target.wants && \ - rm -f alsa-state.service alsa-restore.service && \ - $(LN_S) ../alsa-state.service alsa-state.service && \ - $(LN_S) ../alsa-restore.service alsa-restore.service) - endif edit = \ diff --git a/alsactl/conf/alsa-restore.service.in b/alsactl/conf/alsa-restore.service.in index 80fd5fd48..6a79e4375 100644 --- a/alsactl/conf/alsa-restore.service.in +++ b/alsactl/conf/alsa-restore.service.in @@ -13,3 +13,6 @@ Type=oneshot RemainAfterExit=true ExecStart=-@sbindir@/alsactl restore ExecStop=-@sbindir@/alsactl store + +[Install] +WantedBy=sound.target diff --git a/alsactl/conf/alsa-state.service.in b/alsactl/conf/alsa-state.service.in index 5a8fe5eee..cc5901d52 100644 --- a/alsactl/conf/alsa-state.service.in +++ b/alsactl/conf/alsa-state.service.in @@ -11,3 +11,6 @@ ConditionPathExists=@daemonswitch@ Type=simple ExecStart=-@sbindir@/alsactl -s -n 19 -c rdaemon ExecStop=-@sbindir@/alsactl -s kill save_and_quit + +[Install] +WantedBy=sound.target