]> git.alsa-project.org Git - alsa-utils.git/commitdiff
alsactl: use [Install] instead of .wants/ symlinks for systemd integration
authorClayton Craft <clayton@craftyguy.net>
Wed, 27 May 2026 16:09:43 +0000 (09:09 -0700)
committerJaroslav Kysela <perex@perex.cz>
Fri, 4 Dec 2026 17:18:35 +0000 (18:18 +0100)
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 <clayton@craftyguy.net>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
alsactl/Makefile.am
alsactl/conf/alsa-restore.service.in
alsactl/conf/alsa-state.service.in

index c792137656b1bb69d3f622fb2cbe9b6662ea837a..9e300e2dafb2754d83320c6c8fc5ea830b232a02 100644 (file)
@@ -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 = \
index 80fd5fd482037dcea7f31e3cc2fe7cab91dca898..6a79e437587ac987a78ead5348912e71499abcb0 100644 (file)
@@ -13,3 +13,6 @@ Type=oneshot
 RemainAfterExit=true
 ExecStart=-@sbindir@/alsactl restore
 ExecStop=-@sbindir@/alsactl store
+
+[Install]
+WantedBy=sound.target
index 5a8fe5eeed7efce650d5ab21b4aa1d15fb5575c3..cc5901d52f44ec04b0961a4d027c7d82dbd8c44c 100644 (file)
@@ -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