Problems installing on Tiger Server

Started by tomierna, November 28, 2006, 02:31:06 PM

Previous topic - Next topic

tomierna

Hello!

I have a G4 XServe that I'm trying to install Mail::Toaster on. I'm using Toaster 5.03.

I also run a Toaster on FreeBSD, and it was painless to set up. Apple's mail services on MacOSX Server suck in comparison to qmail/vpopmail/courier, so I figured I'd use Toaster on this box too.

I've got Darwinports installed in the default location (which is not where Toaster expects it, natch).

There appear to be some discrepancies in the docs - the docs say to link my Darwinports install to /usr/dports, but the error shown when running toaster_setup -s ports asks that a link be placed at /usr/ports/dports. I've done that, of course.

The place where I'm having the major issue is when I get to toaster_setup.pl -s pre - it barfs with this message:

oxygen:~/compile/Mail-Toaster-5.03 root# toaster_setup.pl -s pre
The following parameter was passed in the call to Mail::Toaster::Darwin::port_install but was not listed in the validation options: port
at inc/Params/ValidatePP.pm line 639
        Params::Validate::__ANON__('The following parameter was passed in the call to Mail::Toast...') called at inc/Params/ValidatePP.pm line 298
        Params::Validate::validate('ARRAY(0x1941d98)', 'HASH(0x19efed8)') called at lib/Mail/Toaster/Darwin.pm line 35
        Mail::Toaster::Darwin::port_install('undef', 'port', 'p5-net-dns', 'debug', 0) called at lib/Mail/Toaster/Setup.pm line 1543
        Mail::Toaster::Setup::cpan('undef', 'debug', 0) called at lib/Mail/Toaster/Setup.pm line 1852
        Mail::Toaster::Setup::dependencies('undef') called at /usr/local/sbin/toaster_setup.pl line 83


I'm not a Perl guy, so I don't have any idea what's causing this.

I thought it might be that my Perl install was borked, so I pulled a virgin copy from my install disks, but that didn't help either.

Any ideas?

tomierna

I hate to be responding to my own message, but I may have found the bug.

port_install in Darwin.pm refers to port_name in a few places starting at line 36. The caller, Setup.pm, calls $darwin->port_install(port => $_); - the failure is that the caller is sending an array named "port" and the validate call in Darwin.pm expects an array named "port_name".

I changed all instances of "port_name" to "port" in Darwin.pm, and toaster_setup.pl -s pre is running right now.

There's another troubling thing, though; while toaster_setup.pl -s pre did spin through and install the various required p5-* modules via DarwinPorts, it also is installing them via CPAN. I suspect this is due to the fact that through DarwinPorts, the Perl install (and all the modules) are completely insulated from Apple's Perl installation.

By default, DarwinPorts installs its' Perl in /opt/local/bin and libraries in /opt/local/lib, whereas Apple's default location for the Perl binary is /usr/bin, and the libraries are in /System/Library/Perl and /Library/Perl.

I suggest that if DarwinPorts is to be used in the Darwin version of Toaster, that the default behavior of DarwinPorts should likely be respected, i.e., either ignore DarwinPorts for Perl module installation in favor of CPAN on Darwin, or bootstrap into the DarwinPorts version of Perl as soon as it is installed.

tomierna

#2
Sorry to post again, but as I find problems and fixes, I suspect this thread will grow :(

I've run toaster_setup.pl -s pre several times, each time getting further.

For some reason, my install of Net::DNS was failing, so I had to do a force install from the CPAN shell. This may blow up in my face later, I suspect. Tests 9-12 were failing, whatever that means.

Further addressing the issue I posted in the previous message, each time I'm running the "pre" script, it attempts to install each Perl module via Ports. Ports returns 0 for each, so it's quick to get to the part where it attempts to load the required Perl modules, but again, Dports and Perl seems like a tricky area to deal with since it's actually two Perl installations, and the Toaster scripts will use Apple's install and not the Port version.

An aside, today's MacOSX Security Update brings Perl to 5.8.8 from the 5.8.6 which it's been stultifying at since 2005. - this appears to not be the case. I must have had my path wrong at the time.

OK, so I get past the Perl module and DPorts infighting. NetQmail seems to install, and then we get to Autorespond. It barfs on the 'sed' which changes the install path to /opt from /usr. There is a missing escape on line 227 of Setup.pm. It apparently should be:

            "$sed -i '' 's/PREFIX=\$(DESTDIR)\\/usr/PREFIX=\$(DESTDIR)$prefix/g' Makefile",


...or at least adding one there seems to have built my autorespond in /opt/local/bin.

tomierna

#3
When does "newbie" status on the forum change to something else? These and more questions answered, the more I post! (edit: apparently, 5 is the magick number, and I'm now a "Jr. Member". Huzzah!)

toaster_setup support for user/group creation on Darwin seems non-functional.

Darwin uses niutil to manage the passwd and group databases, so it's no surprise that support within Toaster would be lacking, since using anything other than a flat file for passwd and group management is anathema. Except perhaps LDAP. Or YP. Or something.

Anyhoo, I got to the vpopmail install before I saw any errors that reminded me to add users manually. I chose the RSI-inducing Workgroup Manager instead of the insanity-inducing niutil suite. Only a few more steps to go, yay!

tomierna

Another quick note:

Since I didn't have the qmail users/groups created when I ran "pre", the script never actually installed netqmail. So, I had to delete the sources and run it again. There seems to be a pathing bug for the automatic deletion of the netqmail directory when re-running pre.

After getting netqmail to compile nicely, I found that darwin toaster-watcher.conf should probably not have valias support on, or vpopmail won't compile (since by Darwin-default, the mysql support is disabled).

Last tip for the next ten minutes:
Qmailadmin won't compile/install because it can't find autorespond in the default location.

An addition on line 4602 to add a quick lookup to $conf->toaster_prefix seems to make it happy:

$conf_args .= " --build=ppc --enable-autoresponder-path=".$conf->{'toaster_prefix'}."/bin";

tomierna

#5
Another day, another set of posts.

Sqwebmail won't compile, failing with this error:

oxygen:~/compile/Mail-Toaster-5.03 root# toaster_setup.pl -s sqwebmail
courier-authlib build support is not available for darwin yet.
Odd number of parameters in call to Mail::Toaster::Utility::source_warning when named parameters were expected
at inc/Params/ValidatePP.pm line 639
        Params::Validate::__ANON__('Odd number of parameters in call to Mail::Toaster::Utility::s...') called at inc/Params/ValidatePP.pm line 231
        Params::Validate::validate('ARRAY(0x18b5224)', 'HASH(0x19eedec)') called at lib/Mail/Toaster/Utility.pm line 2831
        Mail::Toaster::Utility::source_warning('undef', 'sqwebmail-4.0.7', 1, '/opt/local/src') called at lib/Mail/Toaster/Setup.pm line 7059
        Mail::Toaster::Setup::sqwebmail('undef') called at /usr/local/sbin/toaster_setup.pl line 83


Also, running the toaster_setup.pl -s filter suffers the same inability to see that Perl DPorts isn't available, so it builds all of the P5-* modules through DPorts and then builds them again with CPAN.

tomierna

#6
Now I'm working through step 9 in the install - the logging portion.

toaster_setup.pl -s logging generated an error because the call to:

        $utility->install_from_source(
            conf    => $conf,
            package => "isoqlog-$ver",
            site    => 'http://www.enderunix.org',
            url     => '/isoqlog',
            targets => [ $configure, 'make', 'make install', 'make clean' ],
            patches => '',
            bintest => 'isoqlog',
            debug   => $debug,
            source_sub_dir => 'mail',
        );


... needed the 'patches' parameter to be an array instead of a scalar. I changed it to this:


        $utility->install_from_source(
            conf    => $conf,
            package => "isoqlog-$ver",
            site    => 'http://www.enderunix.org',
            url     => '/isoqlog',
            targets => [ $configure, 'make', 'make install', 'make clean' ],
            patches => [undef],
            bintest => 'isoqlog',
            debug   => $debug,
            source_sub_dir => 'mail',
        );


...and it seems to have compiled.

tomierna

Looks like there is some UID/GID overlappping going on with the way I've installed things.

I'm going to have to wipe things out and start from scratch, I fear.

It's going to have to wait though, because other projects are demanding my time, and this was a "Want to Have" not a "Need to Have".

So, if anyone is following this, or finds it via a search, the end result at the moment is that I was not able to create a working Toaster from version 5.03, running on Tiger Server. I was able to build most everything, but as this thread shows, it was a huge chore. I hope it gets better before I have to work on this project again.

matt

Sorry, Mac OS X doesn't get as well tested as FreeBSD, ostensibly because nobody cares enough about running on OS X to pay for support. It's more a novelty feature.

Anyhow, I made a bunch of updates to 5.04 that will help you get much further with MT on OS X.  Please note, I do all the testing using OS X, not OS X Server, so there may be differences.

Matt

tomierna

Matt,

No worries, I figured it was more of a novelty than anything, but it's a novelty I'm willing to try getting working, because I like MacOSX (and FreeBSD)!

So, in 5.04, I've got some new issues, which I will post as I encounter (and hopefully fix) them.

Line 406 of Passwd.pm is attempting to use $vals->{'username'} which doesn't exist - it comes in as $vals->{'user'}, so I changed it there. User generation seems to work now.

Then, line 2153 of Qmail.pm gets angry with me because it thinks NetQmail is in /opt/local/src/netqmail-1.05 but really it's in /opt/local/src/mail/netqmail-1.05.

I've changed that now, and re-run pre and answer y to delete the netqmail sources, and it's building now.

tomierna

Got to toaster_setup.pl -s vpopmail and it barfed on creating the vpopmail group.

Looks like line 342 (in creategroup) of Passwd.pm desired an array of group => 'groupname', gid => $gid from caller Setup.pm, line 8891.

I added that and it added the vpopmail user and vchkpw group and I'm now re-compiling vpopmail.

tomierna

Building qmailadmin again, and it needs the autorespond path flag - I alluded to this in a previous post.

Now, it's line 4607 that needs to look like this:

$conf_args .= " --build=ppc --enable-autoresponder-path=".$conf->{'toaster_prefix'}."/bin";

tomierna

Well, after some non-small amount of consternation, I've been able to get a message sent via SMTP to an outbound server, and from an outbound server in, all the way through reading it from IMAP.

Qmail's SMTP only worked once I was able to shut Postfix off pretty thoroughly. This included things like unloading the /System/Library/LaunchDaemons/org.postfix.master.plist and restarting the launchd daemon, as well as killing anything owned by postfix.

Now, Qmail answers a telnet port 25.

Running toaster_setup.pl -s supervise seemed broken until I added a /var/service directory and re-ran it.

Also, it doesn't seem that the svscan launchd plist actually does anything. Executing a launchctl load to.yp.cr.daemontools-svscan.plist generates no result, and doesn't show anything when launchctl list is run. I had to start svscan manually. In order to get svscan to care about what I was doing, I had to make a symlink to /service toward /var/service.

Things I haven't figured out yet:
1) logging. Logging seems broken, and I'm not sure why.
toaster-watcher.pl tells me the smtplog and sendlog failed. Presumably this is because they aren't there. Why? Dunno.
2) Command-line mailing, probably including phpmail - these seem to pile up in /var/spool/postfix/maildrop.

Help?

tomierna

#13
Looks like logging was broken because the run files never got put in the /var/service/*/log dirs. I suspect this had to do with my not having a valid symlink from /service to /var/service when I first started running the scripts. I couldn't figure out any way to run toaster_setup.pl to generate just those files. I ended up deleting everything in my service directory, uncommenting the lines from 7184-7197 in Setup.pl, and running toaster_setup.pl -s supervise.

RRD support is borked, and this looks like a lack of talking between the ports install of rrdtools and the Apple Darwin CPAN install of the RRD libs.

I'm still trying to figure out how to make local mail go through qmail instead of ending up in /var/spool/postfix/maildrop.

jesse

#14
It's great to read about your experiences with mail::toaster on OS X Server. I've been trying to get 5.04 working on Mac OS X (client) and currently I'm where you were with the now dual installs of perl (the system's and darwin ports'), and darwin ports and cpan both installing each module, and the Net::DNS problem.

I might stop now and try it on FreeBSD. You have more courage than me! Very impressive.

Jesse