summaryrefslogtreecommitdiff
path: root/startYACY.sh
diff options
context:
space:
mode:
authorLeo <leo@yacy-contrib>2026-04-20 21:32:59 +0800
committerLeo <leo@yacy-contrib>2026-04-20 21:32:59 +0800
commit8a1756d2df8c57dad4b22744be9718a359d372bb (patch)
treeb8852fcad3455f708f0bc2f680b30313e0ec5d7d /startYACY.sh
parent7b303b6f82b1eee57c05e984ce7f4f42fc992405 (diff)
fix: ignore comment lines when reading yacy.conf keys in startYACY.sh (#736)
Previously grep matched commented-out keys like '#javastart_Xmx=512m' alongside the active one, causing invalid JVM args and a cryptic 'Error: Could not find or load main class' failure on Docker start. All three conf key reads (javastart_Xmx, javastart_priority, port) now pipe through 'grep -v '^\s*#'' before key-matching.
Diffstat (limited to 'startYACY.sh')
-rwxr-xr-xstartYACY.sh10
1 files changed, 5 insertions, 5 deletions
diff --git a/startYACY.sh b/startYACY.sh
index 14750d8ca..3b19fcefb 100755
--- a/startYACY.sh
+++ b/startYACY.sh
@@ -197,20 +197,20 @@ then
if [ -z "$YACY_JAVASTART_XMX" ]
then
# When YACY_JAVASTART_XMX is not set or empty:
- # Read from $CONFIGFILE
- j="`grep javastart_Xmx "$CONFIGFILE" | sed 's/^[^=]*=//'`";
+ # Read from $CONFIGFILE (strip comment lines first to avoid matching #javastart_Xmx=...)
+ j="`grep -v '^\s*#' "$CONFIGFILE" | grep 'javastart_Xmx' | sed 's/^[^=]*=//'`";
if [ -n "$j" ]; then JAVA_ARGS="-$j $JAVA_ARGS"; fi;
else
# use the YACY_JAVASTART_XMX variable
JAVA_ARGS="-$YACY_JAVASTART_XMX $JAVA_ARGS"
fi
- # Priority
- j="`grep javastart_priority "$CONFIGFILE" | sed 's/^[^=]*=//'`";
+ # Priority (strip comment lines first)
+ j="`grep -v '^\s*#' "$CONFIGFILE" | grep 'javastart_priority' | sed 's/^[^=]*=//'`";
if [ -n "$j" ]; then JAVA="nice -n $j $JAVA"; fi;
- PORT="`grep ^port= "$CONFIGFILE" | sed 's/^[^=]*=//'`";
+ PORT="`grep -v '^\s*#' "$CONFIGFILE" | grep '^port=' | sed 's/^[^=]*=//'`";
if [ -z "$PORT" ]; then PORT="8090"; fi;
# for i in `grep javastart "$CONFIGFILE"`;do