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@gentoo.org>
This commit is contained in:
Lars Wendler
2019-05-11 20:54:12 +02:00
parent 5a01356128
commit 81ce3ca6fb

View File

@@ -8,6 +8,20 @@ command="/usr/sbin/radeon-profile-daemon"
command_background="true"
pidfile="/run/${SVCNAME}.pid"
start_post() {
chgrp video /tmp/radeon-profile-daemon-server
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() {
wait_for_socket || return 1
chgrp video ${radeon_socket}
}