Page 1 of 1

zmpkg.pl

Posted: Fri Jul 18, 2003 10:17 am
by daktak
Im running Gentoo, and i want to make ZM start on boot.

However zmpkg.pl start doesn't work for me :(
neither does stop or status..

Any ideas?
At the moment every time the pc boots i have to go to the web page and hit "Start" :(

Re: zmpkg.pl

Posted: Fri Jul 18, 2003 10:28 am
by zoneminder
Hi Russell,

I'm a bit surprised that zmpkg.pl won't work from the command line as all the web 'start' command does is call zmpkg.pl anyway. I assume you're trying it as root as it probably won't work as any other user. Do you get any errors from it?

One thing that a few people have mentioned is that some distributions don't support the "su <user> --shell <shell> --command <command>" syntax used in zmpkg.pl and have to use "su <user> -c <command>" instead but this would prevent zmpkg.pl working even from the web interface. It might be worth checking though.

Cheers,

Phil,

Re: zmpkg.pl

Posted: Sat Jul 19, 2003 10:52 am
by daktak
well --shell doesnt work,
running zmpkg.pl as root gives no errors
and i definatly can start the deamons from the web page.

:S
http://members.optusnet.com.au/daktak/zmpkg.jpg

Re: zmpkg.pl

Posted: Sat Jul 19, 2003 4:31 pm
by ananke
oddly enough, on slackware-current I have the exact same problem. Web interface can start it, but zmpkg.pl won't. I haven't looked much into this, figured will just make a note here.

Re: zmpkg.pl

Posted: Sat Jul 19, 2003 4:55 pm
by zoneminder
Have you read Dave Dumulo's document in the Documentation section? This is aimed at an installation on Slakware and I think mentions the 'su' modifications needed.

Phil,

Re: zmpkg.pl

Posted: Mon Jul 21, 2003 1:12 am
by daktak
Yeah, okay I'll recompile zoneminder with the changes specified by Dave Dumulo.

I tired just changing the su stuff in zmpkg.pl and it didnt make a difference.

Re: zmpkg.pl

Posted: Tue Jul 22, 2003 12:47 am
by tfleming
I'm running Gentoo as well and there are a couple things I've noticed about zmpkg.pl. First I needed to use the -c switch on 'su' instead of --shell. Second, remove the single quotes from around the 'su' $command. Here's my 'su' code from the execute method:

$command = "su ".ZM_WEB_USER." -c $command";

Third the status checking code, such as:

my $status = execute( ZM_PATH_BIN."/zmdc.pl check" );
chomp( $status );
if ( $status eq "stopped" )
...

and similar code for start don't work. The $status variable is null after the execute call. (If I execute 'zmdc.pl check' from the command line, it works ok). I commented out the 'if' statements around the start and stop code. Now it works.

Re: zmpkg.pl

Posted: Tue Jul 22, 2003 10:21 am
by daktak
it was su 'ing twice. so i removed these lines from zmpkg.pl under sub_execute.
#{
# $command = "su ".ZM_WEB_USER." -c $command";
#}

For the gentoo'ers out there, here is my zm /etc/init.d script. so you can rc-update it ! :D

#!/sbin/runscript

depend() {
need net
}

start() {
ebegin "Starting ZoneMinder"
start-stop-daemon --start --quiet --background --exec /usr/local/bin/zmpkg.pl start
eend $?
}

stop() {
ebegin "Stopping ZoneMinder"
start-stop-daemon --stop --quiet --exec /usr/local/bin/zmpkg.pl stop
eend $?
}

Re: zmpkg.pl

Posted: Wed Jul 23, 2003 1:43 am
by daktak
of course now the web interface doesnt detect that its runing, so I cant watch a live feed, but oh well.

and above i forgot to mention i commented out the if statement above.