bakuchiku

Installing CrashPlan on OmniOS

The CrashPlan website has installation instructions, but they’re meant for Solaris and aren’t quite right for OmniOS. This guide will show you how to install CrashPlan properly on OmniOS using the Oracle JRE (Java Runtime Environment).

Fixing the System Java

My version of OmniOS Stable (OmniOS v11 r151008) has some sort of packaging problem regarding the JRE. You can skip this section if you like, as it’s not required for installing CrashPlan using the Oracle JRE. I found a solution on an OmniOS mailing list.

The problem is that the system java binary cannot resolve the location of a linked library:

1
2
3
4
5
6
7
8
9
10
% which java
/usr/bin/java
% java -version
ld.so.1: java: fatal: libjli.so: open failed: No such file or directory
% ldd /usr/bin/java
        libthread.so.1 =>        /lib/libthread.so.1
        libjli.so =>     (file not found)
        libdl.so.1 =>    /lib/libdl.so.1
        libc.so.1 =>     /lib/libc.so.1
        libm.so.2 =>     /lib/libm.so.2

But there’s a working version elsewhere:

1
2
3
4
5
6
7
8
9
10
% /usr/java/jre/bin/java -version
openjdk version "1.7.0_21"
OpenJDK Runtime Environment (build 1.7.0_21-b30)
OpenJDK Server VM (build 24.60-b03, mixed mode)
% ldd /usr/bin/java
        libthread.so.1 =>        /lib/libthread.so.1
        libjli.so =>     /usr/java/jre/lib/i386/jli/libjli.so
        libdl.so.1 =>    /lib/libdl.so.1
        libc.so.1 =>     /lib/libc.so.1
        libm.so.2 =>     /lib/libm.so.2

Create a symlink to libjli.so in /usr/lib:

1
2
3
4
5
6
# cd /usr/lib
# ln -s /usr/java/jre/lib/i386/jli/libjli.so
# java -version
openjdk version "1.7.0_21"
OpenJDK Runtime Environment (build 1.7.0_21-b30)
OpenJDK Server VM (build 24.60-b03, mixed mode)

Installing the Oracle JRE

If you try to install CrashPlan now, it will still complain about not having the Sun (Oracle) JRE. You would see this if you had already downloaded CrashPlan, ran pkgadd and accepted the EULA (which we’ll get to later):

1
2
3
4
The current installed version of Java is not the Sun Java Runtime Environment.
CrashPlan requires the Sun JRE.

ERROR: Failed to find an acceptable Sun Java Runtime Environment

It would have been helpful if the CrashPlan instructions had told us that earlier! My guess is that you could just delete the check for the Sun (Oracle) version of Java from the checkinstall script, and use the system OpenJDK version instead. I decided to go ahead and install the Oracle JRE, so you’re on your own if you decide to stick with OpenJDK.

You can manually install the Oracle JRE v7 by downloading the tarball here and copying it to your system. Or, use this handy wget command. I install it into /opt:

1
2
# wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/7u51-b13/jre-7u51-solaris-i586.tar.gz
# tar -xvf jre-7u51-solaris-i586.tar.gz -C /opt

That’s it, the Java install is done! When we install CrashPlan we’ll configure it to use this instead of the system JRE.

Installing CrashPlan

Download and extract the CrashPlan installer tarball:

1
2
# wget http://download1.us.code42.com/installs/solaris/install/CrashPlan/CrashPlan_3.5.3_Solaris.tar.gz
# tar -xvf CrashPlan_3.5.3_Solaris.tar.gz -C /var/spool/pkg

Before installing, we need to modify the checkinstall script to change its java search path so that it finds the Oracle JRE instead of the system one:

1
# sed -i -r 's|^BINSLOC=(.*)$|BINSLOC="/opt/jre1.7.0_51/bin"|' /var/spool/pkg/CrashPlan/install/checkinstall

Before:

1
2
# grep ^BINSLOC /var/spool/pkg/CrashPlan/install/checkinstall
BINSLOC="/bin /usr/bin /usr/local/bin"

After:

1
2
# grep ^BINSLOC /var/spool/pkg/CrashPlan/install/checkinstall
BINSLOC="/opt/jre1.7.0_51/bin"

If you try to install now, pkgadd will complain about the file modifications:

1
2
3
4
5
6
7
8
9
10
11
12
# pkgadd
...
<snip>
...
## Executing checkinstall script.

Reviewing Java installation
## Processing package information.
## Processing system information.
pkgadd: ERROR: packaging file </var/spool/pkg/CrashPlan/install/checkinstall> is corrupt
    file size <2716> expected <2708> actual
    file cksum <36406> expected <35461> actual

So just edit the /var/spool/pkg/CrashPlan/pkgmap file and set the expected values to the new actual values to make it happy.

Before:

1
2
# grep checkinstall /var/spool/pkg/CrashPlan/pkgmap
1 i checkinstall 2716 36406 1392851833

After

1
2
# grep checkinstall /var/spool/pkg/CrashPlan/pkgmap
1 i checkinstall 2708 35461 1392851833

Run pkgadd once again and it should install correctly.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# pkgadd
...
<snip>
...
## Executing postinstall script.
log dir: /opt/sfw/crashplan/log
mkdir: /opt/sfw/crashplan/log: [File exists]

adjusting service xml paths
adjusting manifest path
creating identity path

CrashPlan has been installed.

Important directories:
  Installation:
    /opt/sfw/crashplan
  Logs:
    /opt/sfw/crashplan/log
  Default archive location:
    /opt/sfw/var/crashplan

Start Script (run as root):
  /opt/sfw/crashplan/bin/CrashPlanEngine start|stop

Start Desktop UI:
  /opt/sfw/crashplan/bin/CrashPlanDesktop

You may connect a remote Desktop UI to this Service via port-forwarding
and manage it remotely. Instructions for remote management are in the
readme files placed in your installation directory:
  /opt/sfw/crashplan/doc

To enable CrashPlan as a service (as root):
  /usr/sbin/svccfg import /opt/sfw/crashplan/bin/crashplan.xml
  /usr/sbin/svcadm enable crashplan

Thank you for installing CrashPlan for Solaris.


Installation of <CrashPlan> was successful.

Before we’re finished, update the CrashPlan settings file to use the correct JRE. Edit /opt/sfw/crashplan/install.vars and modify the JAVACOMMON value to point to the Oracle JRE that we just installed. Or, just run this command:

1
# sed -i -r 's|^JAVACOMMON=/usr/bin/java$|JAVACOMMON=/opt/jre1.7.0_51/bin/java|' /opt/sfw/crashplan/install.vars

Before:

1
2
# grep JAVACOMMON /opt/sfw/crashplan/install.vars
JAVACOMMON=/usr/bin/java

After

1
2
# grep JAVACOMMON /opt/sfw/crashplan/install.vars
JAVACOMMON=/opt/jre1.7.0_51/bin/java

I move the CrashPlan install files onto my data pool for backup purposes and in case I need to reinstall the root pool.

1
2
3
# cd /opt/sfw
# mv crashplan /tank/crashplan_install
# ln -s /tank/crashplan_install crashplan

In the case of a reinstall I just need to create the link again.

The last step is to enable the CrashPlan service:

1
2
# svccfg import /opt/sfw/crashplan/bin/crashplan.xml
# svcadm enable crashplan

The service should now be running:

1
2
# ps -ef | grep CrashPlan | grep -v grep
    root  2008     1   0 21:32:17 ?           0:06 /opt/jre1.7.0_51/bin/java -Dfile.encoding=UTF-8 -Dapp=CrashPlanService -Xms20m

If not, check your console for error messages. and/or the crashplan service log file /var/svc/log/crashplan:default.log

Configuration

I used the instructions provided by CrashPlan at Configuring A Headless Client.

Credits

Thanks go to Benjamin Bryan who’s blog post I used for this guide.