commit: 81ce3ca6fbc4d1e55fcf616c89fd85f2902f85b9
Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
AuthorDate: Sat May 11 18:54:12 2019 +0000
Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Sat May 11 18:54:12 2019 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=81ce3ca6
x11-apps/radeon-profile-daemon: init script: wait for the socket creation
Package-Manager: Portage-2.3.66, Repoman-2.3.12
Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>
.../files/radeon-profile-daemon.initd | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/x11-apps/radeon-profile-daemon/files/radeon-profile-daemon.initd
b/x11-apps/radeon-profile-daemon/files/radeon-profile-daemon.initd
index f8ec5179670..e67b9843c25 100644
--- a/x11-apps/radeon-profile-daemon/files/radeon-profile-daemon.initd
+++ b/x11-apps/radeon-profile-daemon/files/radeon-profile-daemon.initd
@@ -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}
}