[Lunar-commits] r20404 - in moonbase/trunk/distributed/distcc: . init.d plugin.d
Jannis Pohlmann
jannis at lunar-linux.org
Tue Jun 13 19:45:26 UTC 2006
Author: jannis
Date: 2006-06-13 19:45:26 +0000 (Tue, 13 Jun 2006)
New Revision: 20404
Modified:
moonbase/trunk/distributed/distcc/POST_INSTALL
moonbase/trunk/distributed/distcc/init.d/distcc
moonbase/trunk/distributed/distcc/plugin.d/optimize-distcc.plugin
Log:
* Add DISTCC_ALLOW (no officially supported environment variable) menu
to the distcc optimization plugin. This allows for easy editing of
allowed distcc client hosts/networks.
* Parse /etc/lunar/local/optimizations.DISTCC in /etc/init.d/distcc
if possible and add DISTCC_ALLOW hosts/networks to the daemon args.
* Updated POST_INSTALL message which now doesn't tell the user to
edit /etc/init.d/distcc by hand anymore. Instead it points to
"lunar optimize".
Modified: moonbase/trunk/distributed/distcc/POST_INSTALL
===================================================================
--- moonbase/trunk/distributed/distcc/POST_INSTALL 2006-06-13 16:46:54 UTC (rev 20403)
+++ moonbase/trunk/distributed/distcc/POST_INSTALL 2006-06-13 19:45:26 UTC (rev 20404)
@@ -1,4 +1,6 @@
message ""
-message "${MESSAGE_COLOR}EDIT /etc/init.d/distcc and /etc/xinet.d/distccd to add your '--allow IPs'"
-message "${MESSAGE_COLOR}If you do not, then the distcc daemon will only allow 127.0.0.1 !!!${DEFAULT_COLOR}"
-message "${MESSAGE_COLOR}If you chose to build in zeroconf support add +zeroconf to DISTCC_HOSTS${DEFAULT_COLOR}"
+message "${MESSAGE_COLOR}Run 'lunar optimize' and add clients which are allowed to use this machine as"
+message "${MESSAGE_COLOR}distcc host. If you do not, then the distcc daemon will only allow 127.0.0.1!${DEFAULT_COLOR}"
+message "${MESSAGE_COLOR}If you chose to invoke distcc via xinet.d, you'll have to edit"
+message "${MESSAGE_COLOR}/etc/xinet.d/distccd to set up client host/network permissions."
+message "${MESSAGE_COLOR}If you chose to build in zeroconf support add +zeroconf to DISTCC_HOSTS.${DEFAULT_COLOR}"
Modified: moonbase/trunk/distributed/distcc/init.d/distcc
===================================================================
--- moonbase/trunk/distributed/distcc/init.d/distcc 2006-06-13 16:46:54 UTC (rev 20403)
+++ moonbase/trunk/distributed/distcc/init.d/distcc 2006-06-13 19:45:26 UTC (rev 20404)
@@ -8,6 +8,15 @@
ARGS="--daemon --user nobody --nice 19 -P /var/run/distccd.pid --allow 127.0.0.1"
+# Append DISTCC_ALLOW values from distcc optimizations to daemon args
+if [ -f /etc/lunar/local/optimizations.DISTCC ]; then
+ . /etc/lunar/local/optimizations.DISTCC
+
+ for host_or_ip_range in $DISTCC_ALLOW; do
+ ARGS="$ARGS --allow $host_or_ip_range"
+ done
+fi
+
reload () {
default_restart
}
Modified: moonbase/trunk/distributed/distcc/plugin.d/optimize-distcc.plugin
===================================================================
--- moonbase/trunk/distributed/distcc/plugin.d/optimize-distcc.plugin 2006-06-13 16:46:54 UTC (rev 20403)
+++ moonbase/trunk/distributed/distcc/plugin.d/optimize-distcc.plugin 2006-06-13 19:45:26 UTC (rev 20404)
@@ -15,8 +15,10 @@
CC_EXT="$CC_EXT distcc"
export CC_EXT
export DISTCC_HOSTS
+ export DISTCC_ALLOW
verbose_msg "CC_EXT=\"$CC_EXT\""
verbose_msg "DISTCC_HOSTS=\"$DISTCC_HOSTS\""
+ verbose_msg "DISTCC_ALLOW=\"$DISTCC_ALLOW\""
fi
return 2
}
@@ -49,6 +51,7 @@
cat > /etc/lunar/local/optimizations.DISTCC <<EOF
USE_DISTCC=$USE_DISTCC
DISTCC_HOSTS="$DISTCC_HOSTS"
+DISTCC_ALLOW="$DISTCC_ALLOW"
EOF
}
@@ -56,7 +59,7 @@
TITLE="Lunar Distcc Optimizations"
while true; do
- RESULT=`$DIALOG --ok-label "Select" --cancel-label "Close" --menu "Use the Distributed C Compiler program distcc?" 0 0 0 "USE_DISTCC" "Use the distributed compiler [$USE_DISTCC]" "DISTCC_HOSTS" "Select remote target hosts..."`
+ RESULT=`$DIALOG --ok-label "Select" --cancel-label "Close" --menu "Use the Distributed C Compiler program distcc?" 0 0 0 "USE_DISTCC" "Use the distributed compiler [$USE_DISTCC]" "DISTCC_HOSTS" "Select remote target hosts..." "DISTCC_ALLOW" "Select allowed client hosts/networks..."`
if [ $? != 0 ]; then
break
elif [ "$RESULT" == "USE_DISTCC" ]; then
@@ -73,6 +76,13 @@
else
save_optimizations
fi
+ elif [ "$RESULT" == "DISTCC_ALLOW" ]; then
+ DISTCC_ALLOW=`$DIALOG --inputbox "Enter a list of hosts or IP ranges (see man distccd).\n127.0.0.1 is already used by default." 9 60 $DISTCC_ALLOW`
+ if [ $? != 0 ]; then
+ continue
+ else
+ save_optimizations
+ fi
fi
done
}
More information about the Lunar-commits
mailing list