Fix crond setpgid error by running in background with tail
All checks were successful
Deploy Production Email Reports (Unified) / deploy (push) Successful in 54s
All checks were successful
Deploy Production Email Reports (Unified) / deploy (push) Successful in 54s
This commit is contained in:
@@ -30,11 +30,29 @@ echo " DB_HOST_CREW: ${DB_HOST_CREW:-not set}"
|
||||
echo " DB_HOST_MERCHBAY: ${DB_HOST_MERCHBAY:-not set}"
|
||||
echo " SMTP_HOST: ${SMTP_HOST:-not set}"
|
||||
|
||||
# Start crond in foreground
|
||||
# Start crond in background
|
||||
echo ""
|
||||
echo "Starting cron daemon in foreground..."
|
||||
echo "Starting cron daemon..."
|
||||
echo "Logs will be written to:"
|
||||
echo " - Cron output: /var/log/cron.log"
|
||||
echo " - Email logs: /app/email.log"
|
||||
echo ""
|
||||
exec crond -f -l 2
|
||||
|
||||
# Start crond in background
|
||||
crond -l 2
|
||||
|
||||
# Verify crond started
|
||||
sleep 2
|
||||
if ! ps aux | grep -v grep | grep -q crond; then
|
||||
echo "ERROR: crond failed to start"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "✓ Cron daemon is running"
|
||||
echo ""
|
||||
echo "Container is ready. Tailing logs..."
|
||||
echo "Press Ctrl+C to stop (but don't - this keeps the container alive!)"
|
||||
echo ""
|
||||
|
||||
# Keep container alive by tailing logs
|
||||
tail -f /var/log/cron.log /app/email.log
|
||||
|
||||
Reference in New Issue
Block a user