Passenger Patched for Solaris. Feedback Needed!

29 views
Skip to first unread message

harrisj

unread,
Jun 17, 2008, 12:08:58 PM6/17/08
to Phusion Passenger Discussions
So I think I've patched Passenger successfully to run under Solaris,
but I need testers -- and more importantly Solaris experts -- to find
any bugs and help fill in patches for other Solaris versions and
architectures.

What are the modifications I made to the core Passenger git?
* Modified apache2 module code to refer to boost::mutex to
disambiguate from Solaris' mutex class.
* Modified extconf.rb to link to the libxnet library and compile with
the -D_XPG4_2 flag when building the native_support.so extension.
* Modified the Rakefile and platform info file to have CFLAGS and
LDFLAGS for building on Solaris. Only GCC is currently supported (not
SunStudio; I even strip out SunStudio flags that trip up gcc that are
reported by apxs if you're using the Coolstack Apache).
* Modified the Rakefile to not abort if asciidoc and doxygen are not
installed.

That's it. Many thanks to those of you in the support forums who
pointed out some of the patches included here. It now builds, runs
rake test:apache successfully and has served pages on an internal
server (but I haven't load tested it yet). Yay! Still, I need your
help in some important ways:

* I've only used it on Solaris 10 x86 with the Coolstack Ruby and
Apache. i don't know what problems it might have on other versions of
Solaris, other architectures, or with other common setups like
Blastwave. Maybe you can try it out?
* To get it to build with Posix and XOpen support, I set it to build
with the following CFLAGS: -D_XOPEN_SOURCE=500 -D_XPG4_2 -
D__EXTENSIONS__ -DBOOST_HAS_STDINT_H (the last one is to tell Boost to
not define stdint types). I am no Solaris expert though, and it's
quite possible I may be using the wrong defines to get the job done.
Solaris build expertise would be very welcome.

How do you try it out? I'd suggest you clone or download the source of
my fork from github
http://github.com/harrisj/passenger/tree/master
If you are unfamiliar with forking and patching via github, the
following page is very helpful: http://railsontherun.com/2008/3/3/how-to-use-github-and-submit-a-patch
I'm not sure on what the best guide to git itself is, but I'm sure you
can find good tutorials out there.

Then try the following:
* make sure gcc, apr-1-config, and apxs are all in your path.
* run rake. If you get a compilation error, post the trace here (note
you will see a warning about casting pid_ts. I think it's harmless,
but we'll get to it).
* run rake test:apache. This should complete all tests. If you get a
relocation error, then there was a linking error. Let me know.
* build the gem locally with rake package. Install with sudo gem
install --local pkg/passenger-VERSION.gem (should be 1.9.1 now)
* run sudo passenger-install-apache2-module. Let me know if there are
any errors there.
* setup passenger to serve a Rails app and let me know how it works.
Thanks!

The best way to report on whether it works is to post a reply to this
message on the mailing list. Please also include the GCC version, how
Apache was installed on the system and the version / architecture of
the machine (uname -a). I'm not sure I can make a fix your problem
personally, but we can all figure it out together. And patches are
always very welcome. And if it does work, please let me know the
architecture details, so we can verify it works there as well (if you
are using an ISP zone like Joyent's Accelerator or the EC2 OpenSolaris
images, be sure to mention that.) Thanks!

Jake

PS One last important note: the official Passenger coding standards
mandate TABS and not SPACES for indentation. Please try to observe
this in any of your patches to make their lives easier. Thanks!

Hongli Lai

unread,
Jun 17, 2008, 12:39:26 PM6/17/08
to phusion-...@googlegroups.com
harrisj wrote:
> * Modified the Rakefile to not abort if asciidoc and doxygen are not
> installed.

Are you sure this is a good idea? Generation of the docs is only
necessary when generating a gem or a tarball. If you leave these checks
out them incomplete gems and tarballs will be generated.

--
Phusion | The Computer Science Company

Web: http://www.phusion.nl/
E-mail: in...@phusion.nl
Chamber of commerce no: 08173483 (The Netherlands)

harrisj

unread,
Jun 17, 2008, 1:42:42 PM6/17/08
to Phusion Passenger Discussions
Hongli,

Sorry, perhaps I was a little too hasty. Doxygen and asciidocs are not
standard installed components on Solaris, and I didn't want the lack
of them (I think you can install doxygen from Sun Freeware, but you
have to build asciidocs) to be one more thing in the way of testing
the Solaris patches. I can roll back that change however if you
want...

Jake

On Jun 17, 12:39 pm, Hongli Lai <hon...@phusion.nl> wrote:
> harrisj wrote:
> > * Modified the Rakefile to not abort if asciidoc and doxygen are not
> > installed.
>
> Are you sure this is a good idea? Generation of the docs is only
> necessary when generating a gem or a tarball. If you leave these checks
> out them incomplete gems and tarballs will be generated.
>
> --
> Phusion | The Computer Science Company
>
> Web:http://www.phusion.nl/
> E-mail: i...@phusion.nl
Message has been deleted

Vincent

unread,
Jul 23, 2008, 4:57:11 AM7/23/08
to Phusion Passenger Discussions
harrisj wrote:
> * run rake. If you get a compilation error, post the trace here

Hi,

I've tried to install it, and I got the following error while running
rake :

** Execute ext/apache2/mod_passenger.so
### In ext/apache2:
g++ -shared Utils.o Logging.o System.o Configuration.o Hooks.o
mod_passenger.o -fPIC -o mod_passenger.so -lxnet -lrt -lsocket -lnsl -
D_XOPEN_SOURCE=500 -D_XPG4_2 -D__EXTENSIONS__ -DBOOST_HAS_STDINT_H -
lstdc++ -lpthread ../boost/src/libboost_thread.a -L/opt/home/vincent/
usr/apache2/lib -lapr-1
ld: fatal: relocation error: file: Logging.o section: .rel.debug_info
symbol: : relocation against a discarded symbol,
symbol is part of discarded
section: .gnu.linkonce.t._ZStorSt13_Ios_OpenmodeS_
collect2: ld returned 1 exit status
rake aborted!
Command failed with status (1): [g++ -shared Utils.o Logging.o
System.o Con...]
/opt/home/vincent/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:
899:in `sh'
/opt/home/vincent/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:
906:in `call'
/opt/home/vincent/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:
906:in `sh'
/opt/home/vincent/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:
985:in `sh'
/opt/home/vincent/usr/src/harrisj-passenger-
a9d69def9423b1dc608c33d235c3b29b3c3ddb58/lib/rake/cplusplus.rb:42:in
`create_shared_library'
/opt/home/vincent/usr/src/harrisj-passenger-
a9d69def9423b1dc608c33d235c3b29b3c3ddb58/Rakefile:140
/opt/home/vincent/usr/src/harrisj-passenger-
a9d69def9423b1dc608c33d235c3b29b3c3ddb58/lib/rake/extensions.rb:117:in
`class_eval'
/opt/home/vincent/usr/src/harrisj-passenger-
a9d69def9423b1dc608c33d235c3b29b3c3ddb58/lib/rake/extensions.rb:117:in
`file'
/opt/home/vincent/usr/src/harrisj-passenger-
a9d69def9423b1dc608c33d235c3b29b3c3ddb58/lib/rake/extensions.rb:116:in
`chdir'
/opt/home/vincent/usr/src/harrisj-passenger-
a9d69def9423b1dc608c33d235c3b29b3c3ddb58/lib/rake/extensions.rb:116:in
`file'
/opt/home/vincent/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:
546:in `call'
/opt/home/vincent/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:
546:in `execute'
/opt/home/vincent/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:
541:in `each'
/opt/home/vincent/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:
541:in `execute'
/opt/home/vincent/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:
508:in `invoke_with_call_chain'
/opt/home/vincent/usr/lib/ruby/1.8/thread.rb:135:in `synchronize'
/opt/home/vincent/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:
501:in `invoke_with_call_chain'
/opt/home/vincent/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:
518:in `invoke_prerequisites'
/opt/home/vincent/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:
1183:in `each'
/opt/home/vincent/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:
1183:in `send'
/opt/home/vincent/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:
1183:in `each'
/opt/home/vincent/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:
515:in `invoke_prerequisites'
/opt/home/vincent/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:
507:in `invoke_with_call_chain'
/opt/home/vincent/usr/lib/ruby/1.8/thread.rb:135:in `synchronize'
/opt/home/vincent/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:
501:in `invoke_with_call_chain'
/opt/home/vincent/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:
518:in `invoke_prerequisites'
/opt/home/vincent/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:
1183:in `each'
/opt/home/vincent/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:
1183:in `send'
/opt/home/vincent/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:
1183:in `each'
/opt/home/vincent/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:
515:in `invoke_prerequisites'
/opt/home/vincent/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:
507:in `invoke_with_call_chain'
/opt/home/vincent/usr/lib/ruby/1.8/thread.rb:135:in `synchronize'
/opt/home/vincent/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:
501:in `invoke_with_call_chain'
/opt/home/vincent/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:
494:in `invoke'
/opt/home/vincent/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:
1931:in `invoke_task'
/opt/home/vincent/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:
1909:in `top_level'
/opt/home/vincent/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:
1909:in `each'
/opt/home/vincent/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:
1909:in `top_level'
/opt/home/vincent/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:
1948:in `standard_exception_handling'
/opt/home/vincent/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:
1903:in `top_level'
/opt/home/vincent/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:
1881:in `run'
/opt/home/vincent/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:
1948:in `standard_exception_handling'
/opt/home/vincent/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:
1878:in `run'
/opt/home/vincent/usr/lib/ruby/gems/1.8/gems/rake-0.8.1/bin/rake:31
/home/vincent/usr/bin/rake:19:in `load'
/home/vincent/usr/bin/rake:19

My version of solaris is : SunOS pictor 5.10 Generic_118855-36 i86pc
i386 i86pc
GCC is : gcc (GCC) 4.0.2 (previously installed by someone else)

And I installed apache2, ruby and rubygems just before passenger :
apache 2.2.9 installed from sources
ruby 1.8.5 installed from sources
rubygems 1.2.0 installed from sources
and latest version of rake : 0.8.1 (from gems)

Thanks for any help !
Vincent

ChrisR

unread,
Aug 12, 2008, 10:34:55 AM8/12/08
to Phusion Passenger Discussions
Hi

Did you get any further with this?
> My version ofsolarisis : SunOS pictor 5.10 Generic_118855-36 i86pc

William

unread,
Sep 3, 2008, 5:18:47 PM9/3/08
to Phusion Passenger Discussions
How soon can we get this into the main tree? Our company would feel
more comfortable if the patch has been applied to the main code base.
The other alternative we're looking at is glassfish. We use Joyent,
but this was done on a Sun X6620 blade chassis.

Well, first I tried the initial install without the gem worked fine:

./bin/passenger-install-apache2-module
Welcome to the Phusion Passenger Apache 2 module installer, v1.9.

--------------------------------------------
The Apache 2 module was successfully installed.

Please edit your Apache configuration file, and add these lines:

LoadModule passenger_module /root/harrisj-passenger/ext/apache2/
mod_passenger.so
PassengerRoot /root/harrisj-passenger
PassengerRuby /opt/lati/bin/ruby

# echo $PATH
/opt/coolstack/apache2/bin:/opt/coolstack/bin:/opt/coolstack/sbin:/opt/
lati/bin:/opt/lati/sbin:/usr/bin:/usr/sbin:/usr/sfw/bin:/usr/sfw/sbin:/
usr/ccs/bin

# uname -an
SunOS laiac1b0z2-int 5.10 Generic_137112-03 i86pc i386 i86pc

# pkginfo -l LATIrubyent
PKGINST: LATIrubyent
NAME: ruby
CATEGORY: application
ARCH: i386
VERSION: 1.8.6p286
BASEDIR: /opt/lati
VENDOR: http://www.rubyenterpriseedition.com/index.html
DESC: ruby 32-bit and 64-bit
PSTAMP: laiac1b2z0-int20080903111435
INSTDATE: Sep 03 2008 11:16
EMAIL: Willia...@latimes.com
STATUS: completely installed
FILES: 14958 installed pathnames
7 shared pathnames
1991 directories
72 executables
52178 blocks used (approx)

# gcc -v
Reading specs from /usr/sfw/lib/gcc/i386-pc-solaris2.10/3.4.3/specs
Configured with: /builds/sfw10-gate/usr/src/cmd/gcc/gcc-3.4.3/
configure --prefix=/usr/sfw --with-as=/usr/sfw/bin/gas --with-gnu-as --
with-ld=/usr/ccs/bin/ld --without-gnu-ld --enable-languages=c,c++ --
enable-shared
Thread model: posix
gcc version 3.4.3 (csl-sol210-3_4-branch+sol_rpath)

Hongli Lai

unread,
Sep 3, 2008, 5:38:40 PM9/3/08
to phusion-...@googlegroups.com
William wrote:
> How soon can we get this into the main tree? Our company would feel
> more comfortable if the patch has been applied to the main code base.

It already is in the main code base. The development version supports
Solaris out of the box. wiki.rubyonrails.org (a Solaris server) is
running on it right now.

--
Phusion | The Computer Science Company

Web: http://www.phusion.nl/
E-mail: in...@phusion.nl

William

unread,
Sep 3, 2008, 7:32:35 PM9/3/08
to Phusion Passenger Discussions
Interesting, what version would that be? I downloaded
http://rubyforge.org/frs/download.php/41025/passenger-2.0.3.tar.gz and
had problems.

Thanks,

On Sep 3, 2:38 pm, Hongli Lai <hon...@phusion.nl> wrote:
> William wrote:
> > How soon can we get this into the main tree? Our company would feel
> > more comfortable if the patch has been applied to the main code base.
>
> It already is in the main code base. The development version supports
> Solaris out of the box. wiki.rubyonrails.org (a Solaris server) is
> running on it right now.
>
> --
> Phusion | The Computer Science Company
>
> Web:http://www.phusion.nl/
> E-mail: i...@phusion.nl

Hongli Lai

unread,
Sep 4, 2008, 4:13:21 AM9/4/08
to phusion-...@googlegroups.com
William wrote:
> Interesting, what version would that be? I downloaded
> http://rubyforge.org/frs/download.php/41025/passenger-2.0.3.tar.gz and
> had problems.

The one in the git repository. That's the development version.

--
Phusion | The Computer Science Company

Web: http://www.phusion.nl/
E-mail: in...@phusion.nl

ChrisR

unread,
Oct 15, 2008, 10:23:31 AM10/15/08
to Phusion Passenger Discussions
It Installed fine on "SunOS neptune 5.10 Generic_120012-14 i86pc i386
i86pc" but i get repeated segmentation errors why I try to access the
rails app :

[Wed Oct 15 15:19:16 2008] [notice] child pid 24720 exit signal
Segmentation fault (11)
[Wed Oct 15 15:19:16 2008] [notice] child pid 24719 exit signal
Segmentation fault (11)
[Wed Oct 15 15:19:16 2008] [notice] child pid 24718 exit signal
Segmentation fault (11)
[Wed Oct 15 15:19:18 2008] [notice] child pid 24723 exit signal
Segmentation fault (11)
[Wed Oct 15 15:19:18 2008] [notice] child pid 24722 exit signal
Segmentation fault (11)
[Wed Oct 15 15:19:18 2008] [notice] child pid 24721 exit signal
Segmentation fault (11)

Any ideas what is wrong?

On Sep 4, 9:13 am, Hongli Lai <hon...@phusion.nl> wrote:
> William wrote:
> > Interesting, what version would that be? I downloaded
> >http://rubyforge.org/frs/download.php/41025/passenger-2.0.3.tar.gzand
> > had problems.
>
> The one in the git repository. That's the development version.
>
> --
> Phusion | The Computer Science Company
>
> Web:http://www.phusion.nl/
> E-mail: i...@phusion.nl

ChrisR

unread,
Dec 2, 2008, 11:22:33 AM12/2/08
to Phusion Passenger Discussions
Is solaris support in 2.0.4?

How good is it? Im desperate to rollout passenger to all my solaris
servers.

Hongli Lai

unread,
Dec 2, 2008, 12:18:44 PM12/2/08
to phusion-...@googlegroups.com
ChrisR wrote:
> Is solaris support in 2.0.4?

No.

> How good is it?

The development version works out-of-the-box with no known issues.

--
Phusion | The Computer Science Company

Web: http://www.phusion.nl/
E-mail: in...@phusion.nl

Sazima

unread,
Dec 3, 2008, 7:02:24 AM12/3/08
to Phusion Passenger Discussions
Hongli,

Hi! What do you mean there is no Solaris support? Wasn't that added
some time ago to the main code base?

Cheers, Sazima

On Dec 2, 3:18 pm, Hongli Lai <hon...@phusion.nl> wrote:
> ChrisR wrote:
> > Is solaris support in 2.0.4?
>
> No.
>
> > How good is it?
>
> The development version works out-of-the-box with no known issues.
>
> --
> Phusion | The Computer Science Company
>
> Web:http://www.phusion.nl/
> E-mail: i...@phusion.nl

Hongli Lai

unread,
Dec 3, 2008, 7:18:14 AM12/3/08
to phusion-...@googlegroups.com
Sazima wrote:
> Hongli,
>
> Hi! What do you mean there is no Solaris support? Wasn't that added
> some time ago to the main code base?

It was added to the master branch, not to the 2.0 branch.

--
Phusion | The Computer Science Company

Web: http://www.phusion.nl/
E-mail: in...@phusion.nl

Jörg Battermann

unread,
Dec 15, 2008, 3:37:59 PM12/15/08
to Phusion Passenger Discussions
Good evening,

any ETA when Solaris support will be 'official'?

Cheers & thanks for all the awesomething things coming from phusion :)

-J

On Dec 3, 1:18 pm, Hongli Lai <hon...@phusion.nl> wrote:
> Sazima wrote:
> > Hongli,
>
> > Hi! What do you mean there is no Solaris support? Wasn't that added
> > some time ago to the main code base?
>
> It was added to the master branch, not to the 2.0 branch.
>
> --
> Phusion | The Computer Science Company
>
> Web:http://www.phusion.nl/
> E-mail: i...@phusion.nl
Reply all
Reply to author
Forward
0 new messages