Subject: [Pljava-dev] deployment feature request

From: John R Pierce <[email-masked]>
Date: Fri, 12 Feb 2016 13:28:29 -0800

In the deployer, it would be handy to catch this exception, and print 
the paths of what it was trying to do.

$ java -jar pljava-packaging/target/pljava-pg9.4-amd64-Linux-gpp.jar
/usr/pgsql-9.4/lib/libpljava-so-1.5.0-BETA1.so Exception in thread 
"main" java.io.IOException: Permission denied
         at java.io.UnixFileSystem.createFileExclusively(Native Method)
         at java.io.File.createTempFile(File.java:2024)
         at org.gjt.cuspy.JarX.extract(JarX.java:692)
         at org.gjt.cuspy.JarX.extract(JarX.java:445)
         at org.gjt.cuspy.JarX.main(JarX.java:419)

[I ran this as the postgres user, I know I have to run it as root on 
redhat/centos since root owns the postgres runtime files and directories]

-- 
john r pierce, recycling bits in santa cruz

_______________________________________________
Pljava-dev mailing list
[email-masked]
http://lists.pgfoundry.org/mailman/listinfo/pljava-dev

---

From: John R Pierce <[email-masked]>
Date: Fri, 12 Feb 2016 14:40:26 -0800

> "main" java.io.IOException: Permission denied 

and man, I wasn't awake when I posted that, I see right there is the 
path.  hah.    still, I think a more operator friendly error would be 
better than the default java stack dump.

---

From: Chapman Flack <[email-masked]>
Date: Fri, 12 Feb 2016 20:27:16 -0500

On 02/12/16 17:40, John R Pierce wrote:
>> /usr/pgsql-9.4/lib/libpljava-so-1.5.0-BETA1.so Exception in thread "main"
>> java.io.IOException: Permission denied 
> 
> and man, I wasn't awake when I posted that, I see right there is the path. 
> hah.

:) If it makes you feel any better, I stared long and hard at your first
message thinking "wait, I thought I *was* printing the path, what went
wrong here?" before seeing it myself.

>    still, I think a more operator friendly error would be better than
> the default java stack dump.

I hear you. :)  I'm a little torn on what to do about it. JarX was this
little thing I wrote 16 years ago aiming for something like "the jar
self-extractor for people who hate self-extractors". The main thing *I*
usually hate about them is they're complex and I'm not sure I know
everything they're really doing, and when something goes wrong they give
me some Marketing-approved help message instead of showing me what
happened. For *my* (weirdly Spartan) tastes, a path name followed by
a "Permission denied" exception is just what I'd want to see....

That said, I have no actual objection to making it friendlier, to
the extent that can be done without breaking the minimalist vibe and
without actually *hiding* the real failure information as so many
installers love to do. I kind of like that it was < 1000 (non-comment)
lines of code 16 years ago, and even now (after adding JSR 223
scriptability but tossing the pre-Java-1.2 compatibility stuff), it
still is. :)

Before I resurrected that old code for this purpose, I had a look at
at least one better-known Java self-extractor generator, I think
it was IzPack: https://github.com/izpack/izpack

According to Open Hub it seems to weigh in around 3.2 million LoC,
or about 100 times the size of PL/Java itself. (They also estimate
it at 947 person-years, again a bit more than 100x the PL/Java figure.)
https://www.openhub.net/p/izpack

Just to get PL/Java's files onto the dumb machine?! :)
That was more than I wanted to try to learn my way around just to have
a simple self-extractor and get this release out.

But maybe, if we find we want more capabilities in the installer, it
will make sense to reevaluate IzPack and/or others that already exist,
as an alternative to building more onto JarX. The big ones can do more
of the job, such as stepping you through downloading and installing
Java itself if it isn't there already. I e-mailed Dave Page about
what EDB likes to see for installers they make available through
StackBuilder in their Windows and Mac packages, and that kind of
heavyweight, handles-everything installer is what would fit that bill.

Maybe I'll have to learn to stop worrying and love giant installers.

-Chap