Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
General
GeneralPortable MacsHardwareNetworking
Applications
Mac ApplicationsEudoraFirefox / MozillaInternet ExplorerOutlook ExpressMS OfficeEntourageExcelPowerPointWordVirtual PCMedia PlayerOther MS Products
Programming
Mac ProgrammingCodeWarriorPerl
Country Specific
Australian Mac GroupUK Mac Group

Mac Forum / Programming / Perl / January 2005



Tip: Looking for answers? Try searching our database.

Mac::Glue and mod_perl

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Brian Dimeler - 14 Jan 2005 16:45 GMT
Sorry for cross-posting this, but i think it applies to both groups.

I'm trying to write a mod_perl script (for PerlRun) that will present an
online interface to my Mac OS X Address Book. Using the standard method
of connecting to the glue (new Mac::Glue 'Address Book') doesn't work;
the webserver complains about not being able to connect to a window
server. So, I'm using Remote Apple Events instead (yes, I remembered to
turn them on in System Preferences):

my $book = new Mac::Glue 'Address Book',
    eppc => 'Address Book',
    'mac8.local' # hosts both the webserver + addressbook
    undef, undef, # uid & pid omitted
    'Mac8', 'mypass' # Mac8 is the Admin user & owner of addressbook

This line apparently causes the server child process to exit:

[Fri Jan 14 11:02:40 2005] [notice] child pid 6070 exit signal Bus error
(10)

However, it works if I run it in a Terminal window (the remainder of the
script successfully prints out a list of address groups). It even works
when run in a Terminal window in a different, non-admin user account, as
long as I include the admin username and pass, as above.

So, does anyone know why it's causing a "bus error" when I try to run it
in the webserver? Is there a workaround?

Brian
Martin Moss - 14 Jan 2005 16:52 GMT
please forgive the really daft question, but have done
a complete server shutdown and restart?

I've come across bus errors before where a complete
server restart made the problem go away and never come
back...

Marty

--- Brian Dimeler <briand@lserve.com> wrote:
> Sorry for cross-posting this, but i think it applies
> to both groups.
[quoted text clipped - 42 lines]
>
>  

   
   
       
___________________________________________________________
ALL-NEW Yahoo! Messenger - all new features - even more fun! http://uk.messenger.yahoo.com
Brian Dimeler - 14 Jan 2005 17:05 GMT
Well, if you mean restarting the whole computer, no; but I had shut down
and restarted the webserver a few times, and always gotten the same results.

> please forgive the really daft question, but have done
> a complete server shutdown and restart?
[quoted text clipped - 4 lines]
>
> Marty
Leo Lapworth - 14 Jan 2005 19:40 GMT
> I'm trying to write a mod_perl script (for PerlRun) that will present an
> online interface to my Mac OS X Address Book.

I've litterally just started to do something like this:

http://svn.cuckoo.org/CPAN/Mac-AddressBook2Web/

It would work very differently though.

1) Script (to put in cron) on OS X box with AddressBook.
2) Export vCard information
3) Upload to webserver (any type) which then uses Text::vCard to process.
4) Process through TT and spit out web pages (will make it
  so you can do what you like with the Text::vCards, e.g. store to DB)

Let me know off list if this helps you and you need specific
functionality. Please be aware that the code is just me working
stuff out at the moment, but the basics work.

Cheers

Leo
Chris Nandor - 14 Jan 2005 22:47 GMT
> I'm trying to write a mod_perl script (for PerlRun) that will present an
> online interface to my Mac OS X Address Book. Using the standard method
[quoted text clipped - 13 lines]
> [Fri Jan 14 11:02:40 2005] [notice] child pid 6070 exit signal Bus error
> (10)

I just took an existing mod_perl script running on my PowerBook and added:

  my $book = new Mac::Glue 'Address Book',
     eppc => 'Address Book',
     'bourque.local', undef, undef,
     'pudge', 'pass';
  print $book->prop('version')->get, "\n\n";
  $book->activate;

I went to the URL in my browser, and it worked.  It printed "3.1.2" and then
brought Address Book to the front.

My wild offhand guess is that you have a different mod_perl than installed
perl: different version, or architecture, or something.

Signature

Chris Nandor                      pudge@pobox.com    http://pudge.net/
Open Source Development Network    pudge@osdn.com     http://osdn.com/

Brian Dimeler - 21 Jan 2005 20:19 GMT
> My wild offhand guess is that you have a different mod_perl than installed
> perl: different version, or architecture, or something.

I'm running Apache 1.3.29, perl 5.8.1, Mac OS X 10.3.4 (all factory
defaults) and mod_perl 1.29 on a G4 PowerPC. I don't -think- there's
anything weird about my mod_perl installation; it was installed from the
TAR file on perl.apache.org. I certainly don't recall any difficulty
setting it up, and it's worked fine except for the Mac::Glue thing. I do
have fast user switching enabled; could that have any effect on this stuff?

Summary of my perl5 (revision 5.0 version 8 subversion 1 RC3) configuration:
  Platform:
    osname=darwin, osvers=7.0, archname=darwin-thread-multi-2level
    uname='darwin hampsten 7.0 darwin kernel version 6.0: fri jul 25
16:58:41 pdt 2003;
root:xnu-344.frankd.rootsxnu-344.frankd~objrelease_ppc power macintosh
powerpc '
    config_args='-ds -e -Dprefix=/usr -Dccflags=-g  -pipe
-Dldflags=-Dman3ext=3pm -Duseithreads -Duseshrplib'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=define use5005threads=undef useithreads=define
usemultiplicity=define
    useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=undef use64bitall=undef uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='cc', ccflags ='-g -pipe -pipe -fno-common -DPERL_DARWIN
-no-cpp-precomp -fno-strict-aliasing -I/usr/local/include',
    optimize='-Os',
    cppflags='-no-cpp-precomp -g -pipe -pipe -fno-common -DPERL_DARWIN
-no-cpp-precomp -fno-strict-aliasing -I/usr/local/include'
    ccversion='', gccversion='3.3 20030304 (Apple Computer, Inc. build
1495)', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=8
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=8
    alignbytes=8, prototype=define
  Linker and Libraries:
    ld='MACOSX_DEPLOYMENT_TARGET=10.3 cc', ldflags ='-L/usr/local/lib'
    libpth=/usr/local/lib /usr/lib
    libs=-ldbm -ldl -lm -lc
    perllibs=-ldl -lm -lc
    libc=/usr/lib/libc.dylib, so=dylib, useshrplib=true,
libperl=libperl.dylib
    gnulibc_version=''
  Dynamic Linking:
    dlsrc=dl_dyld.xs, dlext=bundle, d_dlsymun=undef, ccdlflags=' '
    cccdlflags=' ', lddlflags='-bundle -undefined dynamic_lookup
-L/usr/local/lib'

Characteristics of this binary (from libperl):
  Compile-time options: MULTIPLICITY USE_ITHREADS USE_LARGE_FILES
PERL_IMPLICIT_CONTEXT
  Locally applied patches:
        RC3
  Built under darwin
  Compiled at Sep 12 2003 19:50:49
  @INC:
    /System/Library/Perl/5.8.1/darwin-thread-multi-2level
    /System/Library/Perl/5.8.1
    /Library/Perl/5.8.1/darwin-thread-multi-2level
    /Library/Perl/5.8.1
    /Library/Perl
    /Network/Library/Perl/5.8.1/darwin-thread-multi-2level
    /Network/Library/Perl/5.8.1
    /Network/Library/Perl
    .
Chris Nandor - 27 Jan 2005 16:14 GMT
> I'm running Apache 1.3.29, perl 5.8.1, Mac OS X 10.3.4 (all factory
> defaults) and mod_perl 1.29 on a G4 PowerPC. I don't -think- there's
> anything weird about my mod_perl installation; it was installed from the
> TAR file on perl.apache.org. I certainly don't recall any difficulty
> setting it up, and it's worked fine except for the Mac::Glue thing. I do
> have fast user switching enabled; could that have any effect on this stuff?

I doubt it, but if multiple users are running at once and a different user
is active than the one you're trying to execute with, then perhaps.

Signature

Chris Nandor                      pudge@pobox.com    http://pudge.net/
Open Source Development Network    pudge@osdn.com     http://osdn.com/

Jay - 27 Jan 2005 17:50 GMT
> > I'm running Apache 1.3.29, perl 5.8.1, Mac OS X 10.3.4 (all factory
> > defaults) and mod_perl 1.29 on a G4 PowerPC. I don't -think- there's
> > anything weird about my mod_perl installation; it was installed from the
> > TAR file on perl.apache.org. I certainly don't recall any difficulty
> > setting it up, and it's worked fine except for the Mac::Glue thing. I do
> > have fast user switching enabled; could that have any effect on this stuff?

look at your code vs. Chris':

> my $book = new Mac::Glue 'Address Book',
>         eppc => 'Address Book',
[quoted text clipped - 5 lines]
>
> [Fri Jan 14 11:02:40 2005] [notice] child pid 6070 exit sign

vs.

>    my $book = new Mac::Glue 'Address Book',
>       eppc => 'Address Book',
>       'bourque.local', undef, undef,
>       'pudge', 'pass';
>    print $book->prop('version')->get, "\n\n";
>    $book->activate;

I can't test this right now, but on first blush, it ooks like as you
added comments, you left out the comma after 'mac8.local', and your
thrid and fourth lines come out to:

'mac8.local' undef, undef, [two elements]

instead of

'mac8.local', undef, undef, [three elements]

That's a little typo, but it's a big defference.

HTH,

--jay
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.