Skip to content

Commit b26298c

Browse files
committed
scripts: fix dcache script for Solaris machines
Patch http://rb.dcache.org/r/6293/ (committed as 19c2b52) fixed a problem with the configuration cache not being invalidated. Unfortunately, in fixing a Mac-specific issue, the patch introduced a Solaris-specific issue; specifically, that Solaris machines do not support any options to the hostname command. The result is that calls like 'hostname -s' will set the hostname to '-s'. This patch fixes the problem by using shell's built in filtering. Target: master Ticket: #335 Request: 2.7 Request: 2.6 Request: 2.2 Patch: http://rb.dcache.org/r/6315/ Acked-by: Gerd Behrmann
1 parent 4efc512 commit b26298c

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

skel/share/lib/loadConfig.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,13 @@ bootLoader()
6767
org.dcache.boot.BootLoader "$@"
6868
}
6969

70+
shortHostname()
71+
{
72+
local host
73+
host=$(hostname)
74+
echo ${host%%.*}
75+
}
76+
7077
quickJava()
7178
{
7279
export CLASSPATH
@@ -109,9 +116,10 @@ fi
109116

110117
if [ -s $DCACHE_CACHED_CONFIG ]; then
111118
. $DCACHE_CACHED_CONFIG
119+
# NB. "hostname -s" does not work on Solaris machines
112120
if ! eval isCacheValidForFiles $(getProperty dcache.config.files) ||
113121
! eval isCacheValidForDirs $(getProperty dcache.config.dirs) ||
114-
[ "$(getProperty host.name)" != "$(hostname -s)" ]; then
122+
[ "$(getProperty host.name)" != "$(shortHostname)" ]; then
115123
loadConfig
116124
fi
117125
else

0 commit comments

Comments
 (0)