x11-apps/radeon-profile-daemon: init script: wait for the socket creation
authorLars Wendler <polynomial-c@gentoo.org>
Sat, 11 May 2019 18:54:12 +0000 (20:54 +0200)
committerLars Wendler <polynomial-c@gentoo.org>
Sat, 11 May 2019 18:54:12 +0000 (20:54 +0200)
Package-Manager: Portage-2.3.66, Repoman-2.3.12
Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
x11-apps/radeon-profile-daemon/files/radeon-profile-daemon.initd

index f8ec517967042b084adf23ae15b699596ca979f6..e67b9843c25d7a0df5b2741866b1f27ffe264c64 100644 (file)
@@ -8,6 +8,20 @@ command="/usr/sbin/radeon-profile-daemon"
 command_background="true"
 pidfile="/run/${SVCNAME}.pid"
 
+radeon_socket="/tmp/radeon-profile-daemon-server"
+
+wait_for_socket() {
+       local i=0
+       while [ ${i} -lt 10 ]; do
+               [ -S "${radeon_socket}" ] && return 0
+               i=$((${i}+1))
+               sleep 1s
+       done
+
+       return 1
+}
+
 start_post() {
-       chgrp video /tmp/radeon-profile-daemon-server
+       wait_for_socket || return 1
+       chgrp video ${radeon_socket}
 }