]> git.alsa-project.org Git - alsa-utils.git/commitdiff
alsactl: Add path condition to alsa-store and alsa-restore services
authorTakashi Iwai <tiwai@suse.de>
Mon, 10 Aug 2015 12:42:24 +0000 (14:42 +0200)
committerTakashi Iwai <tiwai@suse.de>
Mon, 10 Aug 2015 12:42:24 +0000 (14:42 +0200)
With alsa-restore.service and alsa-store.service, systemd invokes
alsactl at boot and shutdown times.  When this is invoked on a system
without sound cards, it results in an ugly error message from alsact

  /usr/sbin/alsactl: save_state:1590: No soundcards found...
  return code is "19"

Add ConditionPathExistsGlob checks of /dev/snd/control* devices for
avoiding unnecessary invocations of alsactl on such a system.

Bugzilla: https://bugzilla.suse.com/show_bug.cgi?id=940950
Signed-off-by: Takashi Iwai <tiwai@suse.de>
alsactl/alsa-restore.service.in
alsactl/alsa-store.service.in

index 245a439798fc58f2eb588d19e3db314d4bde8e51..d1a74d637457597a032978a800220e467f52da38 100644 (file)
@@ -6,6 +6,7 @@
 [Unit]
 Description=Restore Sound Card State
 ConditionPathExists=!@daemonswitch@
+ConditionPathExistsGlob=/dev/snd/control*
 DefaultDependencies=no
 After=alsa-state.service
 Before=shutdown.target
index f1a56bb9dbb5826af1a9d4c2c7be10fb877e6c95..c89cfff04f35b4ffabc89911429f7918ba24f28b 100644 (file)
@@ -6,6 +6,7 @@
 [Unit]
 Description=Store Sound Card State
 ConditionPathExists=!@daemonswitch@
+ConditionPathExistsGlob=/dev/snd/control*
 DefaultDependencies=no
 Before=shutdown.target