diff --git a/stack/base-with-services/before-notebook.d/20_start-postgresql.sh b/stack/base-with-services/before-notebook.d/20_start-postgresql.sh index bed884b4..57292fb0 100644 --- a/stack/base-with-services/before-notebook.d/20_start-postgresql.sh +++ b/stack/base-with-services/before-notebook.d/20_start-postgresql.sh @@ -22,7 +22,8 @@ else chmod -R g-rwxs "${PGDATA}" if [[ -f ${PGDATA}/logfile ]]; then - mv "${PSQL_LOGFILE}" "${PSQL_LOGFILE}.1" && gzip "${PSQL_LOGFILE}.1" + rm -f "${PSQL_LOGFILE}.1.gz" + mv "${PSQL_LOGFILE}" "${PSQL_LOGFILE}.1" && gzip "${PSQL_LOGFILE}.1" fi # Cleaning up the mess if PostgreSQL was not shutdown properly. rm -vf "${PGDATA}/postmaster.pid" diff --git a/stack/base/before-notebook.d/40_prepare-aiida.sh b/stack/base/before-notebook.d/40_prepare-aiida.sh index bb6adca0..d3d97643 100755 --- a/stack/base/before-notebook.d/40_prepare-aiida.sh +++ b/stack/base/before-notebook.d/40_prepare-aiida.sh @@ -74,6 +74,9 @@ load_computer('${computer_name}').set_minimum_job_poll_interval(${job_poll_inter else # Migration will run for the default profile. + pgrep -af 'verdi.* daemon' && echo "ERROR: AiiDA daemon is already running!" && exit 1 + ## clean up stale PID-files -> .aiida/daemon/circus-{profile-name}.pid + rm -f /home/${NB_USER}/.aiida/daemon/circus-*.pid verdi storage migrate --force fi