From: Clayton Craft Date: Wed, 27 May 2026 16:09:43 +0000 (-0700) Subject: alsactl: use [Install] instead of .wants/ symlinks for systemd integration X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=b8d57940a321f2b79f66475102ebcbda85102f6d;p=alsa-utils.git 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. Closes: https://github.com/alsa-project/alsa-utils/pull/329 Signed-off-by: Clayton Craft Signed-off-by: Jaroslav Kysela --- diff --git a/alsactl/Makefile.am b/alsactl/Makefile.am index c792137..9e300e2 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 80fd5fd..6a79e43 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 5a8fe5e..cc5901d 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