ZoneMinder / zmdockerfiles

Dockerfiles for the ZoneMinder project build system and for running ZoneMinder
210 stars 106 forks source link

Entrypoint cannot handle external mysql server running in non-standard port #62

Closed hulttis closed 4 years ago

hulttis commented 4 years ago

mysql_running () { if [ "$remoteDB" -eq "1" ]; then mysqladmin ping -u${ZM_DB_USER} -p${ZM_DB_PASS} -h${ZM_DB_HOST} > /dev/null 2>&1 else mysqladmin ping > /dev/null 2>&1 fi local result="$?" if [ "$result" -eq "0" ]; then echo "1" # mysql is running else echo "0" # mysql is not running fi }

According to the zm.conf ZM_DB_HOST can be ip:port - the mysql_running doesn't handle this situation correctly and mysqladmin ping fails. should be f.ex; mysqladmin ping -u${ZM_DB_USER} -p${ZM_DB_PASS} -h${ZM_DB_HOST} -P${ZM_DB_PORT}> /dev/null 2>&1

ZoneMinder database hostname or ip address and optionally port or unix socket

Acceptable formats include hostname[:port], ip_address[:port], or localhost:unix_socket

ZM_DB_HOST="192.168.100.16:3307"

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.