summaryrefslogtreecommitdiffstats
path: root/source/d/icecream/rc.icecream.conf
diff options
context:
space:
mode:
Diffstat (limited to 'source/d/icecream/rc.icecream.conf')
-rw-r--r--source/d/icecream/rc.icecream.conf17
1 files changed, 16 insertions, 1 deletions
diff --git a/source/d/icecream/rc.icecream.conf b/source/d/icecream/rc.icecream.conf
index d0bfaadf0..2c1e0607c 100644
--- a/source/d/icecream/rc.icecream.conf
+++ b/source/d/icecream/rc.icecream.conf
@@ -5,7 +5,22 @@
# Defines the network name used to determine which nodes can be used for
# the compile processes. That way you can have several icecream clusters
# in the same network.
-ICECC_NETWORK=$(hostname -d)
+ICECC_NETWORK=$(hostname -d 2> /dev/null)
+
+# If /etc/HOSTNAME isn't relected in /etc/hosts or through DNS for any reason,
+# then the default ICECC_NETWORK=$(hostname -d) won't be set. So if that
+# variable is empty here, output an error message and exit so that the
+# rc.iceccd script doesn't hang:
+if [ "$ICECC_NETWORK" = "" ]; then
+ echo "ERROR: No network set in \$ICECC_NETWORK, so iceccd and/or icecc-scheduler"
+ echo "will be unable to start. Please make sure that the hostname in /etc/HOSTNAME"
+ echo "is reflected in /etc/hosts or through DNS. You should be able to run"
+ echo "'hostname -d' and see your network domain."
+ echo "This is the current output from 'hostname -d':"
+ echo $(hostname -d)
+ echo "Exiting..."
+ exit 1
+fi
# Defines the options passed to icecc-scheduler:
ICECC_SCHEDULER_OPTIONS="-n $ICECC_NETWORK -d -l /var/log/icecream/icecc-scheduler.log"