summaryrefslogtreecommitdiff
path: root/src/chroot-tools
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2013-06-10 21:59:51 -0600
committerLuke Shumaker <LukeShu@sbcglobal.net>2013-06-10 21:59:51 -0600
commitc77febdf0732512def7f44dafdca5565dbb7d13b (patch)
tree8cda61cbfd8ab3aebe8310a619ac54f7be27e040 /src/chroot-tools
parent5dc737f64940aa8eefca4a24af641f413655a824 (diff)
distcc-tool: fix bugs in odaemon
1. The file permissions on /socket were bad, fix this by setting umask 111 2. In some cases, the child socat wouldn't exit. Add trap to killit on exit.
Diffstat (limited to 'src/chroot-tools')
-rwxr-xr-xsrc/chroot-tools/distcc-tool6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/chroot-tools/distcc-tool b/src/chroot-tools/distcc-tool
index 00156ac..3f7a30f 100755
--- a/src/chroot-tools/distcc-tool
+++ b/src/chroot-tools/distcc-tool
@@ -211,8 +211,10 @@ odaemon() {
[[ $# -eq 1 ]] || panic
local chrootpath=$1
- trap "rm -f '$chrootpath/socket'" EXIT
- socat UNIX-LISTEN:"$chrootpath/socket",fork SYSTEM:"$0 server"
+ umask 111
+ socat UNIX-LISTEN:"$chrootpath/socket",fork SYSTEM:"$0 server" &
+ trap "kill -- $!; rm -f '$chrootpath/socket'" EXIT
+ wait
}
# Usage: idaemon DISTCC_HOSTS