]> git.alsa-project.org Git - alsa-utils.git/commitdiff
alsactl: Only start restore service when asoundrc file exists
authorIkey Doherty <ikey@solus-project.com>
Tue, 12 Dec 2017 13:32:34 +0000 (13:32 +0000)
committerTakashi Iwai <tiwai@suse.de>
Thu, 14 Dec 2017 10:24:40 +0000 (11:24 +0100)
This solves the chicken and egg problem on fresh installations whereby
the alsa state file does not yet exist, and alsa-restore unit attempted
to launch without first having a state file.

Signed-off-by: Ikey Doherty <ikey@solus-project.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
alsactl/Makefile.am
alsactl/alsa-restore.service.in

index 90fab9d13ccc8d2ae37aaf74a7db5b340487e038..aaaf74ee1e1818793653c3fbba04f2b3a1f13371 100644 (file)
@@ -41,6 +41,7 @@ edit = \
        $(SED) -r -e 's,@sbindir\@,$(sbindir),g' \
                  -e 's,@mydatadir\@,$(mydatadir),g' \
                  -e 's,@daemonswitch\@,$(ALSACTL_DAEMONSWITCH),g' \
+                 -e 's,@asoundrcfile\@,$(ASOUND_STATE_DIR)/asound.state,g' \
                                                        < $< > $@ || rm $@
 
 alsa-state.service: alsa-state.service.in
index 80fd5fd482037dcea7f31e3cc2fe7cab91dca898..a84c2e842444e75d06b5debf12608b822a8a4927 100644 (file)
@@ -7,6 +7,7 @@
 Description=Save/Restore Sound Card State
 ConditionPathExists=!@daemonswitch@
 ConditionPathExistsGlob=/dev/snd/control*
+ConditionPathExists=@asoundrcfile@
 
 [Service]
 Type=oneshot