Page 1 of 1

FC15 Startup Fails

Posted: Wed Jun 29, 2011 3:36 pm
by Fmstrat
Hi all,

I recently rebuilt my server to Fedora Core 15, and a freshly installed ZoneMinder won't start. Some outputs:

Code: Select all

[root@server ~]# yum list zoneminder
Loaded plugins: fastestmirror, langpacks, presto, protectbase, refresh-packagekit
Loading mirror speeds from cached hostfile
 * fedora: fedora.mirror.netriplex.com
 * updates: ftp.linux.ncsu.edu
100 packages excluded due to repository protections
Installed Packages
zoneminder.x86_64                        1.24.3-4.20110324svn3310.fc15                         @fedora
[root@server ~]#

Code: Select all

[root@server ~]# service zoneminder start
Starting zoneminder (via systemctl):  Job failed. See system logs and 'systemctl status' for details.
                                                           [FAILED]
[root@server ~]#
I'm not sure if this should even execute just by running command line, but I tried anyway:

Code: Select all

[root@server ~]# zmpkg.pl start
Bareword "PROT_READ" not allowed while "strict subs" in use at /usr/share/perl5/vendor_perl/ZoneMinder/Memory/Mapped.pm line 91.
Bareword "PROT_WRITE" not allowed while "strict subs" in use at /usr/share/perl5/vendor_perl/ZoneMinder/Memory/Mapped.pm line 91.
Bareword "MAP_SHARED" not allowed while "strict subs" in use at /usr/share/perl5/vendor_perl/ZoneMinder/Memory/Mapped.pm line 91.
Compilation failed in require at /usr/share/perl5/vendor_perl/ZoneMinder/Memory.pm line 120.
Compilation failed in require at /usr/share/perl5/vendor_perl/ZoneMinder.pm line 37.
BEGIN failed--compilation aborted at /usr/share/perl5/vendor_perl/ZoneMinder.pm line 37.
Compilation failed in require at /usr/bin/zmpkg.pl line 46.
BEGIN failed--compilation aborted at /usr/bin/zmpkg.pl line 46.
And notes:
  • I created the zm database and ran "mysql zm < /usr/share/zoneminder/db/zm_create.sql", then granted permissions to the zmuser user.
  • Log files appear empty, other than a note that says the same as above in /var/log/messages
  • zm.conf seems OK.
Any ideas on how to debug?

Thanks,
B.

Re: FC15 Startup Fails

Posted: Wed Jun 29, 2011 5:41 pm
by Ritmo2k
Lol, just wrote up the same info on a txt file and walked over to my wkst to post...
Hope it's resolved soon!

Re: FC15 Startup Fails

Posted: Wed Jun 29, 2011 9:08 pm
by zoneminder
I have seen a few reports of this error on Fedora 15, but equally all the F15 installs I have done have all worked fine. I notice you are installing from a rpm, perhaps the dependencies for that are broken. Can you confirm you have the Sys::Mmap perl module installed, the yum package is perl-Sys-Mmap.

Re: FC15 Startup Fails

Posted: Wed Jun 29, 2011 11:11 pm
by Ritmo2k
While that dep is not installed, the problem seems actually to be this:
https://bugzilla.redhat.com/show_bug.cgi?id=711780
Fixed for me...

Re: FC15 Startup Fails

Posted: Thu Jun 30, 2011 7:30 am
by zoneminder
I think that is a red(hat) herring. It is being used correction according to 'perldoc Sys::Mmap'.
NAME
Mmap - uses mmap to map in a file as a Perl variable

SYNOPSIS
use Sys::Mmap;

new Mmap $str, 8192, 'structtest2.pl' or die $!;
new Mmap $var, 8192 or die $!;

mmap($foo, 0, PROT_READ, MAP_SHARED, FILEHANDLE) or die "mmap: $!";
@tags = $foo =~ /<(.*?)>/g;
munmap($foo) or die "munmap: $!";

mmap($bar, 8192, PROT_READ|PROT_WRITE, MAP_SHARED, FILEHANDLE);
substr($bar, 1024, 11) = "Hello world";

mmap($baz, 8192, PROT_READ|PROT_WRITE, MAP_SHARED|MAP_ANON, STDOUT);

$addr = mmap($baz, 8192, PROT_READ|PROT_WRITE, MAP_SHARED|MAP_ANON, STDOUT);
Sys::Mmap::hardwire($qux, $addr, 8192);

DESCRIPTION
The Mmap module uses the POSIX mmap call to map in a file as a Perl variable. Memory access by mmap may be shared between
threads or forked processes, and may be a disc file that has been mapped into memory. Sys::Mmap depends on your operating
system supporting UNIX or POSIX.1b mmap, of course.
So unless there is something recently broken in the Sys::Mmap module there should be no need to put '*' in front of the constant. If you don't have that module installed then I am surprised it even gets that far.

Re: FC15 Startup Fails

Posted: Thu Jun 30, 2011 5:12 pm
by Fmstrat
I did not have the Sys::Mmap module installed, but even after installing the error still occurred. The BugZilla link above did however fix my issue. For those following the thread that don't want to link out, here was the working fix (for me):

Code: Select all

vi /usr/share/perl5/vendor_perl/ZoneMinder/Memory/Mapped.pm
(Of note, the "code" font on the forum hides the underscore between "vendor" and "perl" above) Now change line 91 from

Code: Select all

my $mmap_addr = mmap( $mmap, $size, PROT_READ|PROT_WRITE, MAP_SHARED, \*MMAP );
to

Code: Select all

my $mmap_addr = mmap( $mmap, $size, *PROT_READ|*PROT_WRITE, *MAP_SHARED, \*MMAP );
As stated above, I'm not sure this is a "proper" fix, but it did the trick.

Thanks,
B.

Re: FC15 Startup Fails

Posted: Thu Jun 30, 2011 7:11 pm
by zoneminder
It may not throw an error, but that doesn't necessarily mean it is working correctly so check thoroughly for any errors. As I said before, other F15 installs do not have this problem so there may be something else that is behind this and I'd like to know what.

Re: FC15 Startup Fails

Posted: Thu Jun 30, 2011 7:25 pm
by Fmstrat
zoneminder wrote:It may not throw an error, but that doesn't necessarily mean it is working correctly so check thoroughly for any errors. As I said before, other F15 installs do not have this problem so there may be something else that is behind this and I'd like to know what.
Could you send me the output of "yum list installed" (or similar) of a working FC15 machine? If so I will do a compare against what I've got and see if I can work out a "real" fix.

Also, on your FC15 machines, did you run a full update from the FC15 updates repo? (I did)

Thanks,
B.

Re: FC15 Startup Fails

Posted: Thu Jun 30, 2011 7:29 pm
by KeithB
I've got ZM 1.24.4 to install on Fedora15 and the way to fix the two problems the op is having are firstly to edit /etc/init.d/zm using Vim. When your in the escape mode press ":" (colon) which gets you in the command mode then type

Code: Select all

setfileformat=unix
and press enter
to save and exit press ":" again then wq and exit

edit /etc/php.ini
find where it says:

Code: Select all

short_open_tag = Off
and change it to

Code: Select all

short_opent_tag = On
then after saving and exiting do a

Code: Select all

service httpd restart
then hopefully

Code: Select all

service zm start

should work

If its a repo version then maybe the above zm's will be zoneminder's

Re: FC15 Startup Fails

Posted: Thu Jun 30, 2011 7:52 pm
by Fmstrat
KeithB wrote:I've got ZM 1.24.4 to install on Fedora15 and the way to fix the two problems the op is having are firstly to edit /etc/init.d/zm using Vim. When your in the escape mode press ":" (colon) which gets you in the command mode then type

Code: Select all

setfileformat=unix
and press enter
to save and exit press ":" again then wq and exit

edit /etc/php.ini
find where it says:

Code: Select all

short_open_tag = Off
and change it to

Code: Select all

short_opent_tag = On
then after saving and exiting do a

Code: Select all

service httpd restart
then hopefully

Code: Select all

service zm start

should work

If its a repo version then maybe the above zm's will be zoneminder's

Sorry Keith, I'm not sure what problem you're having/had, but file formats and php short tags are not relevant to the Perl error in this thread. Thanks.

Re: FC15 Startup Fails

Posted: Thu Jun 30, 2011 9:15 pm
by zoneminder
The package list is too long to post, so I have linked it here. This was a fresh install.

Re: FC15 Startup Fails

Posted: Fri Jul 01, 2011 3:19 pm
by Fmstrat
zoneminder wrote:The package list is too long to post, so I have linked it here. This was a fresh install.
First off, have you tried a 64bit install? This is the first thing that stands out :)

Tried to do a comparison on our files, but for some reason your FC15 is putting spaces between data and newlines on a lot of the packages, whereas mine uses tabs and everything on one line, so I can't figure out a good way to diff.

Ex:

Code: Select all

Installed Packages
ConsoleKit.i686     0.4.5-1.fc15    @anaconda-InstallationRepo-201105131946.i686
ConsoleKit-libs.i686
                    0.4.5-1.fc15    @anaconda-InstallationRepo-201105131946.i686
ConsoleKit-x11.i686 0.4.5-1.fc15    @anaconda-InstallationRepo-201105131946.i686

Code: Select all

Installed Packages
BackupPC.x86_64                      3.1.0-17.fc15                      @anaconda-InstallationRepo-201105131943.x86_64
ConsoleKit.x86_64                    0.4.5-1.fc15                       @anaconda-InstallationRepo-201105131943.x86_64
ConsoleKit-libs.x86_64               0.4.5-1.fc15                       @anaconda-InstallationRepo-201105131943.x86_64
ConsoleKit-x11.x86_64                0.4.5-1.fc15                       @anaconda-InstallationRepo-201105131943.x86_64
Ideas on how to make formats match? Played with sed but couldn't get anything consistent.

Thanks,
B.