LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Juniper on slackware-current 64 (https://www.linuxquestions.org/questions/slackware-14/juniper-on-slackware-current-64-a-4175581354/)

the_zone 06-03-2016 07:29 AM

Juniper on slackware-current 64
 
Dear All,

I am trying to get the Juniper NC to work on my slackware box.
Whatever I try, no succes.
My Slackware-current is of 22 aprl 2016.
Juniper has no 32-bit binaries available / requires 32-bit java to be installed.
First thing I did was to
1. make slackware multilib
2. install jre 8.92 - 64 bit version (mistake)

Logging into the (by me) required website Juniper came back with :
1. "Please ensure that necessary 32 bit libraries are installed. For more details, refer KB article KB25230"

2. "Setup failed. Please install 32 bit Java and update alternatives links using update-alternatives command. For more details, refer KB article KB25230"

So I installed the jre 8.92 32 bit.
Since slackware has no update-alternatives I first did an export of PATH to set the correct java directory.
That did not work so I uninstalled the 64-bit version of Java.

I am lost here. Any one a suggestion ?

best regards,

Simon

kjhambrick 06-05-2016 10:50 AM

the_zone --

[edit]

I just saw this:

Quote:

Logging into the (by me) required website Juniper came back with :
If you mean you connect to Juniper via a browser ( say, firefox ), the howto below is only a half-solution.

Try this instead( older release but it looks like it would still work ): http://www.linuxquestions.org/questi...em-4175503089/

[/edit]

1. "Please ensure that necessary 32 bit libraries are installed. For more details, refer KB article KB25230"

2. "Setup failed. Please install 32 bit Java and update alternatives links using update-alternatives command. For more details, refer KB article KB25230"

I've not had to do this recently but this worked on 13.37 to install both 32-bit and 64-bit jdk so I hope the following is helpful ...

If I understand your need, you've got a Slackware64 Current + Multilib system and you need to be able to run a 32-bit Java App ...

If that's the case, there was a recent thread about installing Java 7 and Java 8 on the same system.

It's generally the same problem with different specifics ... ( :) the same only different :) )

32-bit and 64-bit jre on one machine is a lot simpler than Java 7 and Java 8 on one box ...

The key to success is to get the 32-bit jre installed along with the 64-bit jre and then to set your JAVA* Environment Varbs to point at the correct version for the task at hand.

Be sure to install your jre's using the java.SlackBuild that the Slackware Team provides.

Since you've already got multilib, I assume you've got Slackware on your system in a Local Repository ( call it <<YourLocalRepository>> )

64bit: <<YourLocalRepository>>/extra/source/java/ # same as below
32bit: <<YourLocalRepository>>/extra/source/java/ # same as above

Note that the same SlackBuild files will be in either the 32-bit or 64-bit version of <<YourLocalRepository>> but you only need one copy because the java.SlackBuild will repackage any of the Oracle jre-*tgz or jdk-*.tgz files for Slackware.

Look at the extra/source/java/README File and do study-up on the differences between installpkg and updatepkg ...

If you installed your Oracle jre's manually ( i.e. without the java.SlackBuild ), remove them as best you can so you can use the java.SlackBuild.

This is more-or-less how I do it ...

Code:


# 1. One Time Only: make a 'personal' java.SlackBuild directory

mkdir -p /my/local/slackbuilds/java

# 2. Do this step after each slackware update, just in case.  Grab a copy of the Slackware java-Slackbuild and place it in your personal java.SlackBuild directory:

cp -a <<YourLocalRepository>>/extra/source/java/ /my/local/slackbuilds/java/

# 3. download the 32-bit and 64-bit Oracle jre files into /my/local/slackbuilds/java/
#
# check the md5sums and ONLY if they're OK, continue ...

cd /my/local/slackbuilds/java/java  # yes, that is java/java :)

cat README  # look for changes to the procedure ...

# this slackbuild command will create /tmp/jre-8u92-i586-1.txz

./java-Slackbuild ../jre-8u92-linux-i586.tar.gz  # this is the most recent 32-bit version 'today'

# this slackbuild command will create /tmp/jre-8u92-x64-1.txz

./java-Slackbuild ../jre-8u92-linux-x64.tar.gz  # this is the most recent 64-bit version 'today'

# don't install yet ... see below

One feature of Pat's java.SlackBuild is that it includes sets of scripts for /etc/profile.d/ ( one each for jre and jdk and one for .sh and one for .csh )

These scripts set your JAVA* Environment so you can run the version for the ARCH you want to run.

Important: to get both versions on the file system, first run upgradepkg, then run installpkg ...

Since you're on a 64-bit machine, first upgrade the 32-bit jre package first and then save a copy of the 32-bit jre.* files in /etc/profile.d ( jre.csh and jre.sh ).

Then after you've saved the files in /etc/profile.d/ install the 64-bit package and save a copy of the 64-bit jre.* files in /etc/profile.d/ ...

This is one way to do it ...

Code:


# First upgrade the 32-bit jre package.  upgradepkg will remove old versions of BOTH the 32-bit and 64-bit jre

upgradepkg --install-new /tmp/jre-8u92-i586-1.txz  # first do an upgrade --install-new is only required for the very-first install

# save a copy of the 32-bit Environment stuff ..

cd /etc/profile.d

for i in sh csh
do
  cp -p jre.$i jre.$i-32
done

# now install the 64-bit jre package ...

installpkg /tmp/jre-8u92-x64-1.txz          # then do an install

# now save a copy of the 64-bit Environment stuff ..

cd /etc/profile.d

for i in sh csh
do
  cp -p jre.$i jre.$i-64
done

# check your work.  You should have both 32-bit and 64-bit packages installed.  The default is 64-bit

ls -la /var/log/packages/jre-*

-rw-r--r-- 1 root root 19286 Jun  5 10:10 /var/log/packages/jre-8u92-i586-1
-rw-r--r-- 1 root root 20002 Jun  5 10:10 /var/log/packages/jre-8u92-x86_64-1


# note that this install order leaves your system configured for the 64-bit jre
#
# after the two copy operations, you should see this in /etc/profile.d/

ls -la jre*

-rwxr-xr-x 1 root root 124 Jun  5 08:47 jre.csh*
-rwxr-xr-x 1 root root 122 Jun  5 09:46 jre.csh-32*
-rwxr-xr-x 1 root root 124 Jun  5 08:47 jre.csh-64*
-rwxr-xr-x 1 root root 127 Jun  5 08:47 jre.sh*
-rwxr-xr-x 1 root root 125 Jun  5 09:46 jre.sh-32*
-rwxr-xr-x 1 root root 127 Jun  5 08:47 jre.sh-64*

# note that these are all executable.  However the code in /etc/profile will not execute the copies you made because they don't end in .sh

Finally ... to set your JAVA* Environment for 32-bit, do this in a terminal:

Code:


. /etc/profile.d/jre.sh-32  # that's dot-space ...

# do whatever you need to do to start the juniper app.

If this works from a terminal, see the third link below ... jenv recommended by Richard Cranium looks like a 'keeper'.

HTH

-- kjh

p.s. maybe these links will helpful to solve your problem:

http://alien.slackbook.org/dokuwiki/...kware:multilib

http://docs.slackware.com/howtos:software:java

http://www.linuxquestions.org/questi...em-4175579072/

Richard Cranium's link to jenv looks useful for what you need to do.

the_zone 06-06-2016 03:43 AM

@kjhambrick
Thanks a lot for the help.

I have it working of some sort.

I followed both the Firefox install and Java install instructions.
Both where helpful and insightful.

Unfortunately I had to uninstall Firefox-45.1 64-bit.

First I installed the 32-bit version next to the 64-bit version which I installed according with compat32pkg.
http://compat32pkg.sourceforge.net/documentation.html

Checking upon which Firefox version (64/32 bit) I was actually using (menu->help->Troubleshooting Information) I noticed both versions were 64-bit.

So that clearly did not work.

Removing the 64-bit solved the issue and I could login on the required website.

the_zone 06-06-2016 04:09 AM

Solved the Firefox 32/64 issue as well.
Both are now happily and working beside each other.

The trick was to create a profile while executing firefox from the 32-bit install dir.

http://askubuntu.com/questions/11194.../202415#202415

kjhambrick 06-06-2016 04:23 AM

the_zone --

Yes ... I see that I did miss the fact that you connect to Juniper via a browser rather than via a 32-bit Java App :)

To run either 32-bit firefox or 64-bit firefox on your machine you'll need some sort of a shell script wrapper for the 32-bit version so that you set your environment and then invoke the 32-bit firefox instead of the default 64-bit firefox.

Or ... if you used Alien Bob's convertpkg-compat32 script to make your 32-bit firefox and you've got both 32-bit and 64-bit firefox installed, it might work if you invoke from a commandline either:
Code:

/usr/lib/firefox-45.1.1/firefox
# or
/usr/bin/32/firefox

/usr/bin/32/firefox is a symlink to /usr/lib/firefox-45.1.1/firefox created by Alien Bob's convertpkg-compat32 script.

edit -- I type too slow :) Glad you fixed it !

--- kjh

ruario 06-06-2016 12:34 PM

Sorry for the delayed reply. I only just saw this. I used Juniper VPN in my previous company, so I have a little input here.

The main thing I would add is that you do not need Java installed to connect to a Juniper VPN or at least you did not the last time I tried this, which was a couple of years ago.

I started investigating because installing Java, starting a web browser, even having to have X running just to do a VPN connection seems like an overkill to me.

Java is only used as a GUI front end to launch the native program that actually handles the connection (ncsvc). However it is possible to get the 'ncsvc' connection program without Java installed and use a small shell script to start it up. Here is how I did it in 6 easy steps. ;)
  • Login to to the VPN login page (with any browser).
  • After logging in enter the following URL to download the file 'ncLinuxApp.jar', where vpndomain is the actual domain you use to connect to your VPN normally.

https://vpndomain/dana-cached/nc/ncLinuxApp.jar

  • Extract the contents of ncLinuxApp.jar to suitable place in your home directory.

Code:

mkdir -p $HOME/.juniper_networks
unzip ncLinuxApp.jar -d $HOME/.juniper_networks

  • Setup the VPN certificate

Code:

cd $HOME/.juniper_networks
bash getx509certificate.sh vpndomain vpndomain.cert
chmod 600 vpndomain.cert

  • Switch to root and setuid the ncsvc executable

Code:

chown root:root ncsvc
chmod 4711 ncsvc

  • Create a suitable startup script (example follows) and place it somewhere in your $PATH:

Code:

#!/bin/sh
cd \$HOME/.juniper_networks
echo -n "Enter VPN username [\${USER}]: "
read -e _user
[ "\${_user}" ] || _user=\${USER}
./ncsvc -h vpndomain -u \${_user} -f vpndomain.cert -r companyrealm


Notes:
  • ncsvc is 32-bit only so you will need multilib on Slacware64
  • Change vpndomain in all examples above to be the domain name you use.
  • You need the companyrealm to be the realm you are using. I worked out the realm by looking at the html source code when loading vpndomain in a browser. i.e.:

Code:

<input type="hidden" name="realm" value="companyrealm">
  • ncsvc (and hence the example startup script) does not fork to the background by default. Either start in a spare terminal or just background it manually after you have provided login credentials. You can obviously disconnect by issuing Ctrl+c in the terminal it is running in (if it is still foregrounded) or by killing the process. Or if you
    really want, the following also works: $HOME/.juniper_networks/ncsvc -K
  • A connection log is stored in: $HOME/.juniper_networks/network_connect/ncsvc.log
  • The rest of the ncsvc options are: -h <hostname> -u <username> -p <password> [-r <realm> ] -f <certificate_in_der_format> [-P <service_port>] [L <log_level>] [-g] [-y <proxy> -z <proxy_port> [-x<proxy_username> -a <proxy_password> [-d<proxy_domain>]]]. In addition: Shutdown/kill = ncsvc -K and Version = ncsvc -v

the_zone 06-08-2016 08:22 AM

@ruario
Thanks for the reponse.

I will have a go at this.

Since initial login is by username, password and authentication app I am afraid a lot of info is hidden for me.


All times are GMT -5. The time now is 08:07 PM.