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" :(
zmpkg.pl
- zoneminder
- Site Admin
- Posts: 5215
- Joined: Wed Jul 09, 2003 2:07 pm
- Location: Bristol, UK
- Contact:
Re: zmpkg.pl
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,
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
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
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
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.
- zoneminder
- Site Admin
- Posts: 5215
- Joined: Wed Jul 09, 2003 2:07 pm
- Location: Bristol, UK
- Contact:
Re: zmpkg.pl
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,
Phil,
Re: zmpkg.pl
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.
I tired just changing the su stuff in zmpkg.pl and it didnt make a difference.
Re: zmpkg.pl
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.
$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
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 $?
}
#{
# $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
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.
and above i forgot to mention i commented out the if statement above.