From: Lars Wendler Date: Sat, 11 May 2019 18:54:12 +0000 (+0200) Subject: x11-apps/radeon-profile-daemon: init script: wait for the socket creation X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=81ce3ca6fbc4d1e55fcf616c89fd85f2902f85b9;p=gentoo.git 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 --- 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 f8ec51796704..e67b9843c25d 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} }