Skip to content

Cron service in foreground #2010

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions code/web/release_notes/24.09.00.MD
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@
// lucas
### Other updates
- Add supportingCompany support in Docker scripts. (*LM*)
- Now cron process is executed in foreground at the end of the start up script. (*LM*)

// James Staub
### Reports
Expand Down
1 change: 0 additions & 1 deletion docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ services:
- ${ASPEN_DATA_DIR}/logs:/var/log/aspen-discovery
depends_on:
- backend
entrypoint: cron -f -L 2

db:
image: ${MARIADB_IMAGE:-mariadb:10.5}
Expand Down
28 changes: 14 additions & 14 deletions docker/files/scripts/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,30 +9,30 @@ cd "/usr/local/aspen-discovery/docker/files/scripts" || exit
# Check if site configuration exists
confSiteFile="$CONFIG_DIRECTORY/conf/config.ini"
if [ ! -f "$confSiteFile" ] ; then
mkdir -p "$CONFIG_DIRECTORY"
if ! php createConfig.php "$CONFIG_DIRECTORY" ; then
echo "ERROR : FAILED TO CREATE ASPEN SETTINGS"
exit 1
fi
mkdir -p "$CONFIG_DIRECTORY"
if ! php createConfig.php "$CONFIG_DIRECTORY" ; then
echo "ERROR : FAILED TO CREATE ASPEN SETTINGS"
exit 1
fi

fi

# Initialize Aspen database
if ! php initDatabase.php ; then
echo "ERROR : FAILED TO INITIALIZE DATABASE"
exit 1
echo "ERROR : FAILED TO INITIALIZE DATABASE"
exit 1
fi

# Initialize Koha Connection
if ! php initKohaLink.php ; then
echo "ERROR : FAILED TO ESTABLISH A CONNECTION WITH KOHA"
exit 1
echo "ERROR : FAILED TO ESTABLISH A CONNECTION WITH KOHA"
exit 1
fi

# Create missing dirs and fix ownership and permissions if needed
if ! php createDirs.php ; then
echo "ERROR : FAILED TO CREATE DIRECTORIES OR TRY TO FIX OWNERSHIP AND PERMISSIONS"
exit 1
echo "ERROR : FAILED TO CREATE DIRECTORIES OR TRY TO FIX OWNERSHIP AND PERMISSIONS"
exit 1
fi

# Move and create temporarily sym-links to etc/cron directory
Expand Down Expand Up @@ -62,9 +62,9 @@ curl -k http://"$SITE_NAME"/API/SystemAPI?method=runPendingDatabaseUpdates

# Start Cron
if [ "$ASPEN_CRON" == "yes" ]; then
service cron start
php /usr/local/aspen-discovery/code/web/cron/checkBackgroundProcesses.php "$SITE_NAME" &
cron -f -L 2
else
/bin/bash -c "trap : TERM INT; sleep infinity & wait"
fi

# Infinite loop
/bin/bash -c "trap : TERM INT; sleep infinity & wait"