ZM fails to start at boot

Forum for questions and support relating to the 1.24.x releases only.
Locked
camsystem
Posts: 32
Joined: Fri Aug 12, 2011 8:35 pm

ZM fails to start at boot

Post by camsystem »

I have an existing installation of ZM 1.24.2 working great on top of Ubuntu server 10.04 LTS 32 bit. Upgraded to ZM 1.24.4 and everything seems to be working OK. I had to create my cameras but that was no problem. Only issue I have left is that when I reboot the server ZM fails to start automatically. I have to connect to ZM over web and then start ZM. Server has now ran over night with no issues. I have confirmed via web admin that ZM is set to start at boot. Checked logs, dmesg, syslog, & messages, but cannot find anything to indicate why ZM does not start at boot.
Can anyone give me an idea of why ZM does not start at boot since the upgrade to 1.24.4?

Thanks in advance.
PacoLM
Posts: 971
Joined: Wed Dec 02, 2009 9:55 pm
Location: Spain

Re: ZM fails to start at boot

Post by PacoLM »

I think is a know topic, something like ZM starting before mysql. The fix was adding a sleep 10 in the /etc/init.d/zoneminder startup file:

Code: Select all

start() {
        echo -n "Starting $prog: "
-->    sleep 10
        $command start
        RETVAL=$?
        [ $RETVAL = 0 ] && echo success
        [ $RETVAL != 0 ] && echo failure
        return $RETVAL
}
Give it try or search the forum, I'm writing from memory, I could be wrong.
Hope it helps,

PacoLM

After more than 15 years, no longer using ZM as surveillance system.
Now in the dark side, using a commercial system...
camsystem
Posts: 32
Joined: Fri Aug 12, 2011 8:35 pm

Re: ZM fails to start at boot

Post by camsystem »

Thanks a heap PacoLM
I will give that a try.
camsystem
Posts: 32
Joined: Fri Aug 12, 2011 8:35 pm

Re: ZM fails to start at boot

Post by camsystem »

Put

Code: Select all

sleep 10
into the startup but ZM still will not start on a reboot. O' well it was a good tip that I will remember. Still researching the issue. Any other ideas will be appreciated.
camsystem
Posts: 32
Joined: Fri Aug 12, 2011 8:35 pm

Re: ZM fails to start at boot

Post by camsystem »

Updated all packages on server as follows: The following packages will be upgraded:
base-files libapache2-mod-php5 libldap-2.4-2 libldap2-dev php5-common
php5-mysql
Ran make install

Still cannot get ZM to start on boot buts seems to work. It would be useful to be able to start and stop ZM from the command line. I have tried the following:
service zoneminder start zoneminder: unrecognized service
service zm start zm: unrecognized service
zoneminder start zoneminder: command not found
zm start zm: command not found
Tried the commands from the /etc/init.d/ directory but got the same results.


Anybody got any ideas or know some different way to get ZM to start and stop from the command line???? or why ZM is not starting on boot???
Thanks in advance as all ideas are appreciated.
PacoLM
Posts: 971
Joined: Wed Dec 02, 2009 9:55 pm
Location: Spain

Re: ZM fails to start at boot

Post by PacoLM »

To run ZM as a service, install chkconfig or rcconf, then select zoneminder to startup at boot. The command line to start zm is usually

Code: Select all

service zoneminder start
or

Code: Select all

service zm start
, depending on how you install it / compile it.

After more than 15 years, no longer using ZM as surveillance system.
Now in the dark side, using a commercial system...
camsystem
Posts: 32
Joined: Fri Aug 12, 2011 8:35 pm

Re: ZM fails to start at boot

Post by camsystem »

That is what I thought PacoLM. I have tried both of these commands.

Code: Select all

service zoneminder start
zoneminder: unrecognized service

Code: Select all

service zm start
zm: unrecognized service

Weird! Maybe this is somehow tied to why ZM does not start from boot. Always starts just fine from web console.

Thanks anyway PacoLM. Any other ideas will be welcome.
zSeries
Posts: 30
Joined: Thu Aug 18, 2011 12:43 pm

Re: ZM fails to start at boot

Post by zSeries »

I had this problem too, Zoneminder was starting before mysql and so failed to start at boot. Try this

update-rc.d -f zoneminder remove
then
update-rc.d zoneminder defaults 92
camsystem
Posts: 32
Joined: Fri Aug 12, 2011 8:35 pm

Re: ZM fails to start at boot

Post by camsystem »

Thanks for the suggestion zseries (sounds like IBM?) Since this is my experimental box, I decided to through caution to the wind, Tried the suggestion even though I do not understand what was trying to accomplish.

Code: Select all

update-rc.d -f zoneminder remove
Removing any system startup links for /etc/init.d/zoneminder ...
Died at /usr/sbin/update-rc.d line 57.

Did not look promising but tried the second line anyway

Code: Select all

update-rc.d zoneminder defaults 92
update-rc.d: /etc/init.d/zoneminder: file does not exist

Hmmmmmm maybe the syntax is wrong.

No change in the way ZM behaves. ZM does not start at boot but can be started from the web console. ZM works great after it is up and running. If ZM was trying to start before SQL would not I see some errors in /var/log/messages or one of the ZM logs? was the syntax wrong?
PacoLM
Posts: 971
Joined: Wed Dec 02, 2009 9:55 pm
Location: Spain

Re: ZM fails to start at boot

Post by PacoLM »

Maybe you do not have the startup script, check if you have one of these files:

ls -l /etc/init.d/zoneminder
ls -l /etc/init.d/zm

If so, check that the paths are ok, and correspond to your system.

After more than 15 years, no longer using ZM as surveillance system.
Now in the dark side, using a commercial system...
Locked