Fix emul-setup-audio-volume.service using incorrect dependency 33/225633/3
authorINSUN PYO <insun.pyo@samsung.com>
Fri, 21 Feb 2020 10:28:41 +0000 (19:28 +0900)
committerINSUN PYO <insun.pyo@samsung.com>
Fri, 21 Feb 2020 10:39:42 +0000 (19:39 +0900)
The emul-setup-audio-volume.service runs before the udev event has been processed, so you can not access /dev/snd.

journal log
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Feb 21 19:16:53.365733 localhost systemd[1]: emul-setup-audio-volume.service: Installed new job emul-setup-audio-volume.service/start as 94
Feb 21 19:16:53.396470 localhost systemd[1]: emul-setup-audio-volume.service: About to execute: /usr/bin/amixer cset 'name='Master Playback Switch'' 1
Feb 21 19:16:53.396503 localhost systemd[1]: emul-setup-audio-volume.service: Forked /usr/bin/amixer as 1808
Feb 21 19:16:53.396537 localhost systemd[1]: emul-setup-audio-volume.service: Changed dead -> start
Feb 21 19:16:53.397748 localhost systemd[1]: Got cgroup empty notification for: /system.slice/emul-setup-audio-volume.service
Feb 21 19:16:53.408826 localhost amixer[1808]: amixer: Control default open error: Permission denied

Feb 21 19:16:53.365469 localhost systemd-udevd[1589]: chmod '/dev/snd/seq' 0660
Feb 21 19:16:53.365479 localhost systemd-udevd[1589]: chown '/dev/snd/seq' 0 29
Feb 21 19:16:53.365490 localhost systemd-udevd[1589]: chmod '/dev/snd/timer' 0660
Feb 21 19:16:53.365498 localhost systemd-udevd[1589]: chown '/dev/snd/timer' 0 29
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

systemd-udevd.service only tells you that you are ready to process uevent.
You should use systemd-udev-settle.service to see if the actual uevent has been processed.

Change-Id: I9a43047dff740ff76d46ca895cee731c1df3c4eb
Signed-off-by: INSUN PYO <insun.pyo@samsung.com>
filesystem/usr/lib/systemd/system/emul-setup-audio-volume.service

index a193214..50d9ffe 100644 (file)
@@ -1,7 +1,8 @@
 [Unit]
 Description=Audio volume setup on emulator
 DefaultDependencies=no
-After=systemd-udevd.service
+Wants=systemd-udev-settle.service
+After=systemd-udev-settle.service
 
 [Service]
 User=service_fw