summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wendler <polynomial-c@gentoo.org>2019-05-11 20:54:12 +0200
committerLars Wendler <polynomial-c@gentoo.org>2019-05-11 20:54:12 +0200
commit81ce3ca6fbc4d1e55fcf616c89fd85f2902f85b9 (patch)
tree6d482789b8ad6cca94c7320172f41d0c1137df1c /x11-apps
parentgui-wm/sway: 1.1_rc2 bump (diff)
downloadgentoo-81ce3ca6fbc4d1e55fcf616c89fd85f2902f85b9.tar.gz
gentoo-81ce3ca6fbc4d1e55fcf616c89fd85f2902f85b9.tar.bz2
gentoo-81ce3ca6fbc4d1e55fcf616c89fd85f2902f85b9.zip
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>
Diffstat (limited to 'x11-apps')
-rw-r--r--x11-apps/radeon-profile-daemon/files/radeon-profile-daemon.initd16
1 files changed, 15 insertions, 1 deletions
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}
}