#!/bin/bash

stopServices() {
        service apache2 stop
        service postgresql stop
}
trap stopServices TERM

chown -Rf postgres:postgres /var/lib/postgresql/12/main

service postgresql start
service apache2 start

touch /app/src/data-sources/osmfile/touchy

# fork a process and wait for it
tail -f /var/log/postgresql/postgresql-12-main.log &
wait
