multimedia/zoneminder: rc script runs mysql commands?

Boris Samorodov bsam at passap.ru
Wed Jan 11 18:16:48 UTC 2012


11.01.2012 21:58, Mark Felder пишет:
> 
> The zoneminder port has this in its rc script which really should go away:
>
> zm_prestart() {
> local _count=0
> 
>          while : ; do
>                  echo "USE zm; SELECT Username from Users where Id=1;" | \
>                          /usr/local/bin/mysqltest -u root zm > /dev/null  
> 2>&1 && return
>                  _count=$(( $_count + 1 ))
>                  if [ $_count -gt 10 ]; then
>                          err 1 "${name}: mysqltest command failed"
>                  fi
> 
>                  sleep 1
>          done
> }

> If you have your mysql install on a different server (which you should if  
> you have tons of cameras and events) the startup fails to work. I can't  
> see a reason why this should be kept, but perhaps someone else has an  
> idea? This isn't a common practice in any other program that requires a  
> database....

The problem is: while start-up zoneminder is launched after mysql
was started but is not responding yet. Then zoneminder can't register
it's cameras, etc. This hack was introduced to catch the moment when
mysql really is operational and then start zoneminder.

If someone has a solution -- you are welcome.

-- 
WBR, Boris Samorodov (bsam)
FreeBSD Committer, http://www.FreeBSD.org The Power To Serve


More information about the freebsd-ports mailing list