Using force_start when starting the APMIA, two issues usually arise: When starting a second time, the lock-file is not removed. Also, the APMIA script does not handle correctly the HUP signal issued by the docker-server to delete the lockfile.
APMIA and Unix environments.
So - when using scripts, one can set the huponexit value to true. At the same time, make sure the old pid file is deleted.
#!/usr/bin/env bash
shopt -u huponexit
nohup bash -c "rm -f /opt/apmia/bin/apmia.pid && /opt/apmia/apmia-ca-installer.sh force_start" 2>/dev/null &
exit 0
shopt -u huponexit nohup bash -c "rm -f /opt/apmia/bin/apmia.pid && /opt/apmia/apmia-ca-installer.sh force_start" 2>/dev/null & exit 0