Hi there!
I just emerged the zm ebuild that comes with portage and fixed several things to get it running (permission stuff, missing event folder, etc.).
zmpkg.pl start works fine but as far as I have read the documentation there should be an init script as well to bring it up every time the system boots.
I found an init script posted somewhere in the forum but that didn't work for me.
It would be nice if anyone had a suggestion...
howto get init script on gentoo?
- lazyleopard
- Posts: 403
- Joined: Tue Mar 02, 2004 6:12 pm
- Location: Gloucestershire, UK
Mine looks like this. You may have to tweak the "use" line and the "ZM_PATH*" bits:
Code: Select all
#!/sbin/runscript
# Start and stop zoneminder (for Gentoo)
opts="start stop status"
depend() {
use mysql apache2
}
prog=ZoneMinder
ZM_PATH_BIN="/usr/bin"
command="$ZM_PATH_BIN/zmpkg.pl"
start() {
ebegin "Starting $prog"
$command start
eend $? "Failed to start $prog"
}
stop() {
ebegin "Stopping $prog"
$command stop
eend $? "Failed to stop $prog"
}
status() {
result=`$command status`
if [ "$result" = "running" ]; then
echo "ZoneMinder is running"
RETVAL=0
else
echo "ZoneMinder is stopped"
RETVAL=1
fi
exit ${RETVAL}
}
Rick Hewett
thanks for the fast reply
unfortunately it doesn't work for me
I am using apache2 and mysql as well - both of them are running.
The path seems to be correct as well - I have /usr/bin/zmpkg.pl
if I try to start the script I get the following output
and this is what can be found in /var/log/messages
is there possibly a permission-problem again?
unfortunately it doesn't work for me
I am using apache2 and mysql as well - both of them are running.
The path seems to be correct as well - I have /usr/bin/zmpkg.pl
if I try to start the script I get the following output
Code: Select all
* Re-caching dependency info (mtimes differ)...
* Starting ZoneMinder ...
* Failed to start ZoneMinder [ !! ]
Code: Select all
localhost zm # /etc/init.d/zm start
Nov 30 17:41:31 localhost su(pam_unix)[6258]: session opened for user apache by (uid=0)
Nov 30 17:41:31 localhost su(pam_unix)[6258]: session closed for user apache
Nov 30 17:41:31 localhost rc-scripts: Failed to start ZoneMinder
- lazyleopard
- Posts: 403
- Joined: Tue Mar 02, 2004 6:12 pm
- Location: Gloucestershire, UK
Could be all sorts of things; missing directories, permissions, shared memory, ...
Look for messages in /var/log/messages, /var/log/syslog (etc.) and also in the zoneminder error-log files.
As zoneminder is running as user apache you have to make sure that apache has a valid shell set in /etc/passwd .
Look for messages in /var/log/messages, /var/log/syslog (etc.) and also in the zoneminder error-log files.
As zoneminder is running as user apache you have to make sure that apache has a valid shell set in /etc/passwd .
Rick Hewett
good god - I think that this was the hardest piece of work that I have done so far - my init script still isn't working (or perhaps wiping out the other errors killed this errors as well) - but I don't really need it anymway
I wonder if there is anyone who managed to get zoneminder running using the ebuild right at the first try...
It took me about two weekends to find out which folders were not created where permissions went wrong and where links had to be added...
I guess next ime I will give your custom ebuild a try...
but in fact I really hope that this system will stay alive for all eternity.. so that I do not have to rebuild it...
perhaps I will post my experiences on the gentoo bug list...
thanks for your efforts anyway!
and in general thanks for this great App!
I wonder if there is anyone who managed to get zoneminder running using the ebuild right at the first try...
It took me about two weekends to find out which folders were not created where permissions went wrong and where links had to be added...
I guess next ime I will give your custom ebuild a try...
but in fact I really hope that this system will stay alive for all eternity.. so that I do not have to rebuild it...
perhaps I will post my experiences on the gentoo bug list...
thanks for your efforts anyway!
and in general thanks for this great App!
- lazyleopard
- Posts: 403
- Joined: Tue Mar 02, 2004 6:12 pm
- Location: Gloucestershire, UK
I had a hard time getting an init script to start Zoneminder under Gentoo. I could start it from the web interface but not from the command line or during init.
I changed a few things and now have it working. First I gave the 'apache' user shell access. Second I changed the 'execute' function in zmpkg.pl (about line 150) to the following:
I also made sure the log directory (/var/log/zm) was owned by user 'apache'. Now the init script (similar to what lazyleopard published) works.
I changed a few things and now have it working. First I gave the 'apache' user shell access. Second I changed the 'execute' function in zmpkg.pl (about line 150) to the following:
Code: Select all
$command = "su ".ZM_WEB_USER." -c '$command'";