Re: multimedia/zoneminder: rc script runs mysql commands?

2012-04-02 Thread Mark Felder

On Mon, 02 Apr 2012 16:37:46 -0500, wwwdrich  wrote:

I have a K.I.S.S. solution I have been running for a while. Just source  
the zm.conf file into the init script and then use the variables there 
for the mysql test.


I like this idea a lot. Is it breaking any guidelines? I assume as long as  
we aren't hardcoding the path to the zm.conf we should be OK, yes?

___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "freebsd-ports-unsubscr...@freebsd.org"


Re: multimedia/zoneminder: rc script runs mysql commands?

2012-04-02 Thread wwwdrich
I have a K.I.S.S. solution I have been running for a while. Just source the
zm.conf file into the init script and then use the variables there for the
mysql test. The way I'm doing it is:

. /usr/local/etc/zm.conf
while : ; do
echo "USE zm; SELECT Username from Users where Id=1;" | \
/usr/local/bin/mysqltest -h ${ZM_DB_HOST} -u
${ZM_DB_USER} -p${ZM_DB_PASS} ${ZM_DB_NAME} > /dev/null 2>&1 && return


--
View this message in context: 
http://freebsd.1045724.n5.nabble.com/multimedia-zoneminder-rc-script-runs-mysql-commands-tp5137566p5613799.html
Sent from the freebsd-ports mailing list archive at Nabble.com.
___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "freebsd-ports-unsubscr...@freebsd.org"


Re: multimedia/zoneminder: rc script runs mysql commands?

2012-01-13 Thread Mark Felder

On Fri, 13 Jan 2012 03:20:13 -0600, Alex Dupre  wrote:


Boris Samorodov ha scritto:

Actually this should not happen. mysql rc script has a poststart
directive to wait until the daemon is up and running.


Last time I used the port (zoneminder) a year ago. It was the case.
Has something changed in a year?


MySQL rc script was patched 3 years ago.



Sounds like it's safe to remove this from zoneminder then.
___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "freebsd-ports-unsubscr...@freebsd.org"


Re: multimedia/zoneminder: rc script runs mysql commands?

2012-01-13 Thread Alex Dupre

Boris Samorodov ha scritto:

Actually this should not happen. mysql rc script has a poststart
directive to wait until the daemon is up and running.


Last time I used the port (zoneminder) a year ago. It was the case.
Has something changed in a year?


MySQL rc script was patched 3 years ago.

--
Alex Dupre
___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "freebsd-ports-unsubscr...@freebsd.org"


Re: multimedia/zoneminder: rc script runs mysql commands?

2012-01-12 Thread Ion-Mihai Tetcu
On Wed, 11 Jan 2012 20:14:18 +
Michael Scheidell  wrote:

> 
>  We have the same problem with a commercial product. Is the user
> decided to pull a black cord Instead of a soft shut down, the next
> time a power it up, sometimes there is a race conditions between time
> out on the services that are looking to a running sequel server, and
> the database recovery. rc ordering is a good way to at least give me
> a hint which 1 needs to start first but has everyone has observed, it
> in a bit self cannot guarantee this service is running. you could do
> something funky with wait pid but you might not want the system to
> hang waiting for everything to start. some kind of passive wait loop
> 2 seconds wait loop 4 seconds wait loop 10 seconds wait loope 60
> seconds wait loop 120 seconds but this is not a free bsd porting
> issue. Uostream would need to look at it.

Yes, but at least some kind of check if the service actually started,
some echo in the console / logging would be veyr good.



>  From:
> owner-freebsd-po...@freebsd.org [owner-freebsd-po...@freebsd.org] on
> behalf of Ion-Mihai Tetcu [ite...@freebsd.org] Sent: Wednesday,
> January 11, 2012 2:47 PM To: Mark Felder Cc:
> freebsd-ports@freebsd.org Subject: Re: multimedia/zoneminder: rc
> script runs mysql commands?
> 
> On Wed, 11 Jan 2012 12:41:27 -0600
> Mark Felder  wrote:
> 
> > On Wed, 11 Jan 2012 12:16:45 -0600, Boris Samorodov 
> > wrote:
> >
> > > The problem is: while start-up zoneminder is launched after mysql
> > > was started but is not responding yet.
> 
> This, unfortunatelly, highlights perhaps our biggest problem with
> starting services.
> 
> rc.d basically only *orders* the scripts
> - REQUIRE is just "this service needs to be started after that one"
> - AFTER is just a lax checkpoint in the booting sequence
> And if a script doesn't really start the service, for whatever reason,
> there's 0 feedback mandeted/provided by the framework.
> 
> For short, while everything works OK, it's good enough. If not ...
> it's just misleading.
> 
> --
> IOnut - Un^d^dregistered ;) FreeBSD "user"
>   "Intellectual Property" is   nowhere near as valuable   as
> "Intellect" FreeBSD committer -> ite...@freebsd.org, PGP Key ID
> 057E9F8B493A297B ___
> freebsd-ports@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-ports
> To unsubscribe, send any mail to
> "freebsd-ports-unsubscr...@freebsd.org"
> __
> This email has been scanned and certified safe by SpammerTrap(r). For
> Information please see http://www.spammertrap.com/
> __ 
> 


-- 
IOnut - Un^d^dregistered ;) FreeBSD "user"
  "Intellectual Property" is   nowhere near as valuable   as "Intellect"
FreeBSD committer -> ite...@freebsd.org, PGP Key ID 057E9F8B493A297B
___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "freebsd-ports-unsubscr...@freebsd.org"


Re: multimedia/zoneminder: rc script runs mysql commands?

2012-01-12 Thread Boris Samorodov

12.01.2012 14:23, Alex Dupre пишет:

Boris Samorodov ha scritto:

The problem is: while start-up zoneminder is launched after mysql
was started but is not responding yet.


Actually this should not happen. mysql rc script has a poststart
directive to wait until the daemon is up and running.


Last time I used the port (zoneminder) a year ago. It was the case.
Has something changed in a year?

--
WBR, Boris Samorodov (bsam)
FreeBSD Committer, http://www.FreeBSD.org The Power To Serve
___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "freebsd-ports-unsubscr...@freebsd.org"


Re: multimedia/zoneminder: rc script runs mysql commands?

2012-01-12 Thread Alex Dupre

Boris Samorodov ha scritto:

The problem is: while start-up zoneminder is launched after mysql
was started but is not responding yet.


Actually this should not happen. mysql rc script has a poststart 
directive to wait until the daemon is up and running.


--
Alex Dupre
___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "freebsd-ports-unsubscr...@freebsd.org"


Re: multimedia/zoneminder: rc script runs mysql commands?

2012-01-12 Thread perryh
Chris Rees  wrote:

> On 11 January 2012 18:44, Doug Barton  wrote:
> > On 1/11/2012 10:41 AM, Mark Felder wrote:
> >> perhaps we should see if we can get the mysql maintainer(s) to
> >> fix the mysql rc script so it doesn't exit until the service is
> >> fully fired up and functional?
> >
> > That is attractive all on its own of course, however it still
> > doesn't solve the OP's problem, since his mysqld is not local.
>
> Well... actually it would.
>
> With mysql's startup fixed, hacks like this would be unneccessary ...

How so?  If zoneminder needs the mysql _on a different machine_ to
be running, how would altering that machine's mysql rc script help
zoneminder?
___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "freebsd-ports-unsubscr...@freebsd.org"


RE: multimedia/zoneminder: rc script runs mysql commands?

2012-01-11 Thread Michael Scheidell

 We have the same problem with a commercial product. Is the user decided to 
pull a black cord Instead of a soft shut down, the next time a power it up, 
sometimes there is a race conditions between time out on the services that are 
looking to a running sequel server, and the database recovery. rc ordering is a 
good way to at least give me a hint which 1 needs to start first but has 
everyone has observed, it in a bit self cannot guarantee this service is 
running. you could do something funky with wait pid but you might not want the 
system to hang waiting for everything to start. some kind of passive wait loop 
2 seconds wait loop 4 seconds wait loop 10 seconds wait loope 60 seconds wait 
loop 120 seconds but this is not a free bsd porting issue. Uostream would
 need to look at it.

From: owner-freebsd-po...@freebsd.org [owner-freebsd-po...@freebsd.org] on 
behalf of Ion-Mihai Tetcu [ite...@freebsd.org]
Sent: Wednesday, January 11, 2012 2:47 PM
To: Mark Felder
Cc: freebsd-ports@freebsd.org
Subject: Re: multimedia/zoneminder: rc script runs mysql commands?

On Wed, 11 Jan 2012 12:41:27 -0600
Mark Felder  wrote:

> On Wed, 11 Jan 2012 12:16:45 -0600, Boris Samorodov 
> wrote:
>
> > The problem is: while start-up zoneminder is launched after mysql
> > was started but is not responding yet.

This, unfortunatelly, highlights perhaps our biggest problem with
starting services.

rc.d basically only *orders* the scripts
- REQUIRE is just "this service needs to be started after that one"
- AFTER is just a lax checkpoint in the booting sequence
And if a script doesn't really start the service, for whatever reason,
there's 0 feedback mandeted/provided by the framework.

For short, while everything works OK, it's good enough. If not ... it's
just misleading.

--
IOnut - Un^d^dregistered ;) FreeBSD "user"
  "Intellectual Property" is   nowhere near as valuable   as "Intellect"
FreeBSD committer -> ite...@freebsd.org, PGP Key ID 057E9F8B493A297B
___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "freebsd-ports-unsubscr...@freebsd.org"
__
This email has been scanned and certified safe by SpammerTrap(r).
For Information please see http://www.spammertrap.com/
__

___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "freebsd-ports-unsubscr...@freebsd.org"


Re: multimedia/zoneminder: rc script runs mysql commands?

2012-01-11 Thread Boris Samorodov
11.01.2012 22:41, Mark Felder пишет:

> I imagine what you've described is a situation where MySQL has  
> a lot of databases/tables/et

Unfortunately, it happens even if zoneminder is a lonely user
of mysql. The pause (at my three-year-old server) was about
5 seconds...

-- 
WBR, Boris Samorodov (bsam)
FreeBSD Committer, http://www.FreeBSD.org The Power To Serve
___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "freebsd-ports-unsubscr...@freebsd.org"


Re: multimedia/zoneminder: rc script runs mysql commands?

2012-01-11 Thread Ion-Mihai Tetcu
On Wed, 11 Jan 2012 12:41:27 -0600
Mark Felder  wrote:

> On Wed, 11 Jan 2012 12:16:45 -0600, Boris Samorodov 
> wrote:
> 
> > 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.  
> 
> Instead of hacking up zoneminder's rc script with further patches
> like pulling out the real mysql server, database, username and
> password perhaps we should see if we can get the mysql maintainer(s)
> to fix the mysql rc script so it doesn't exit until the service is
> fully fired up and functional?

This, unfortunatelly, highlights perhaps our biggest problem with
starting services.

rc.d basically only *orders* the scripts 
- REQUIRE is just "this service needs to be started after that one"
- AFTER is just a lax checkpoint in the booting sequence
And if a script doesn't really start the service, for whatever reason,
there's 0 feedback mandeted/provided by the framework.

For short, while everything works OK, it's good enough. If not ... it's
just misleading.

-- 
IOnut - Un^d^dregistered ;) FreeBSD "user"
  "Intellectual Property" is   nowhere near as valuable   as "Intellect"
FreeBSD committer -> ite...@freebsd.org, PGP Key ID 057E9F8B493A297B
___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "freebsd-ports-unsubscr...@freebsd.org"


Re: multimedia/zoneminder: rc script runs mysql commands?

2012-01-11 Thread Chris Rees
On 11 January 2012 18:44, Doug Barton  wrote:
> On 1/11/2012 10:41 AM, Mark Felder wrote:
>> Instead of hacking up zoneminder's rc script with further patches like
>> pulling out the real mysql server, database, username and password
>> perhaps we should see if we can get the mysql maintainer(s) to fix the
>> mysql rc script so it doesn't exit until the service is fully fired up
>> and functional?
>
> That is attractive all on its own of course, however it still doesn't
> solve the OP's problem, since his mysqld is not local.
>

Well... actually it would.

With mysql's startup fixed, hacks like this would be unneccessary, so
could be removed.

Chris
___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "freebsd-ports-unsubscr...@freebsd.org"


Re: multimedia/zoneminder: rc script runs mysql commands?

2012-01-11 Thread Mark Felder

On Wed, 11 Jan 2012 12:44:26 -0600, Doug Barton  wrote:



That is attractive all on its own of course, however it still doesn't
solve the OP's problem, since his mysqld is not local.



Yeah, that was me -- the OP -- and I'm sitting here brainstorming but  
haven't been able to come up with many alternatives yet unless we want to  
add what I feel is unnecessary complexity to the zoneminder rc script.  
There has to be a K.I.S.S. solution hiding somewhere

___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "freebsd-ports-unsubscr...@freebsd.org"


Re: multimedia/zoneminder: rc script runs mysql commands?

2012-01-11 Thread Doug Barton
On 1/11/2012 10:41 AM, Mark Felder wrote:
> Instead of hacking up zoneminder's rc script with further patches like
> pulling out the real mysql server, database, username and password
> perhaps we should see if we can get the mysql maintainer(s) to fix the
> mysql rc script so it doesn't exit until the service is fully fired up
> and functional?

That is attractive all on its own of course, however it still doesn't
solve the OP's problem, since his mysqld is not local.


-- 

You can observe a lot just by watching. -- Yogi Berra

Breadth of IT experience, and depth of knowledge in the DNS.
Yours for the right price.  :)  http://SupersetSolutions.com/

___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "freebsd-ports-unsubscr...@freebsd.org"


Re: multimedia/zoneminder: rc script runs mysql commands?

2012-01-11 Thread Mark Felder

On Wed, 11 Jan 2012 12:16:45 -0600, Boris Samorodov  wrote:


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.


Instead of hacking up zoneminder's rc script with further patches like  
pulling out the real mysql server, database, username and password perhaps  
we should see if we can get the mysql maintainer(s) to fix the mysql rc  
script so it doesn't exit until the service is fully fired up and  
functional? I imagine what you've described is a situation where MySQL has  
a lot of databases/tables/etc and churns for a bit before accepting  
connections, but if it finally hits a badly crashed table or something and  
doesn't complete starting up but the rc script already exited... that  
wouldn't be good.


Advantage: better behavior
Disadvantage: slows up the start process of all dependent services.


This is all speculation at this point, but it seems silly that the mysql  
rc script would finish before the database can really accept connections.

___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "freebsd-ports-unsubscr...@freebsd.org"


Re: multimedia/zoneminder: rc script runs mysql commands?

2012-01-11 Thread Boris Samorodov
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
___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "freebsd-ports-unsubscr...@freebsd.org"