Compare commits

..

1 Commits

Author SHA1 Message Date
MickLesk
103497a361 fix(tools.func): fix meilisearch import-dump background process handling
When killing the background meilisearch process after dump import,
bash would print a 'Terminated' job notification and trigger
'pop_var_context: head of shell_variables not a function context'
errors (visible as /dev/fd/63 line errors), causing the rest of
the update_script to not execute. This left meilisearch stopped
after migration and caused subsequent update runs to skip it
(binary version already matched latest).

Two fixes:
- Redirect background process output to /dev/null to suppress
  meilisearch startup log noise in the update output
- Add 'wait $MEILI_PID' after 'kill $MEILI_PID' so bash properly
  reaps the child process without printing a job status notification

Fixes #14276
2026-05-08 21:29:37 +02:00
2 changed files with 2 additions and 8 deletions

View File

@@ -69,13 +69,6 @@ DB_ROOT_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13)
mysql -u root -e "ALTER USER 'root'@'localhost' IDENTIFIED BY '${DB_ROOT_PASS}'; FLUSH PRIVILEGES;"
$STD sudo -u frappe bash -c 'export PATH="$HOME/.local/bin:$PATH"; cd /opt && bench init --frappe-branch version-15 frappe-bench'
$STD sudo -u frappe bash -c 'export PATH="$HOME/.local/bin:$PATH"; cd /opt/frappe-bench && bench get-app erpnext --branch version-15'
msg_info "Starting Redis Services for Site Setup"
$STD sudo -u frappe bash -c 'redis-server /opt/frappe-bench/config/redis_queue.conf --daemonize yes'
$STD sudo -u frappe bash -c 'redis-server /opt/frappe-bench/config/redis_cache.conf --daemonize yes'
sleep 3
msg_ok "Started Redis Services for Site Setup"
$STD sudo -u frappe bash -c "export PATH=\"\$HOME/.local/bin:\$PATH\"; cd /opt/frappe-bench && bench new-site site1.local --db-root-username root --db-root-password \"$DB_ROOT_PASS\" --admin-password \"$ADMIN_PASS\" --install-app erpnext --set-default"
msg_ok "Initialized Frappe Bench"

View File

@@ -7588,7 +7588,7 @@ function setup_meilisearch() {
# Start meilisearch with --import-dump flag
# This is a one-time import that happens during startup
/usr/bin/meilisearch --config-file-path /etc/meilisearch.toml --import-dump "$DUMP_FILE" &
/usr/bin/meilisearch --config-file-path /etc/meilisearch.toml --import-dump "$DUMP_FILE" >/dev/null 2>&1 &
local MEILI_PID=$!
# Wait for meilisearch to become healthy (import happens during startup)
@@ -7611,6 +7611,7 @@ function setup_meilisearch() {
# Stop the manual process
kill $MEILI_PID 2>/dev/null || true
wait $MEILI_PID 2>/dev/null || true
sleep 2
# Start via systemd for proper management