Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] alsactl: Only start restore service when asoundrc file exists
@ 2017-12-12 13:32 Ikey Doherty
  2017-12-14 10:25 ` Takashi Iwai
  0 siblings, 1 reply; 2+ messages in thread
From: Ikey Doherty @ 2017-12-12 13:32 UTC (permalink / raw)
  To: alsa-devel

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>
---
 alsactl/Makefile.am             | 1 +
 alsactl/alsa-restore.service.in | 1 +
 2 files changed, 2 insertions(+)

diff --git a/alsactl/Makefile.am b/alsactl/Makefile.am
index 90fab9d..aaaf74e 100644
--- a/alsactl/Makefile.am
+++ b/alsactl/Makefile.am
@@ -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
diff --git a/alsactl/alsa-restore.service.in b/alsactl/alsa-restore.service.in
index 80fd5fd..a84c2e8 100644
--- a/alsactl/alsa-restore.service.in
+++ b/alsactl/alsa-restore.service.in
@@ -7,6 +7,7 @@
 Description=Save/Restore Sound Card State
 ConditionPathExists=!@daemonswitch@
 ConditionPathExistsGlob=/dev/snd/control*
+ConditionPathExists=@asoundrcfile@
 
 [Service]
 Type=oneshot
-- 
2.15.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-12-14 10:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-12 13:32 [PATCH] alsactl: Only start restore service when asoundrc file exists Ikey Doherty
2017-12-14 10:25 ` Takashi Iwai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox