Automating GS install | Developer's Forum | Forums

Welcome to the GlobalSight forums. Raise topics for discussion or follow ongoing discussions to keep track of what’s going on.

Select the forum that you are most interested in and join the discussion. All forums are moderated and comments are reviewed before publishing.

Please consider registering
guest

Log In Register

Register | Lost password?
Advanced Search

— Forum Scope —

  

— Match —

   

— Forum Options —

   

Minimum search word length is 4 characters - maximum search word length is 84 characters

Topic RSS
Automating GS install
September 20, 2016
1:46 pm
RK
Member
Forum Posts: 7
Member Since:
September 20, 2016
Offline

Hi

I'm trying to create a script that automates the installation of GlobalSight on Ubuntu 14.04. I run into an issue when I try to automate running the Install.sh script. I pass the commands I would normally type in by hand as STDIN for that process.

sudo -u jboss -H sh << EOF
cd
cd GlobalSight/install
./Install.sh << EOF2
N
3
5
$GLOBALSIGHTPWD
M
7
3
true
4
true
I
Y

EOF2
EOF

For some reason this does not work and I get an exception

Problem running installer.
java.lang.NullPointerException
at util.InstallUtil.getString(InstallUtil.java:190)
at util.InstallUtil.getSelection(InstallUtil.java:369)
at util.InstallUtil.getSelection(InstallUtil.java:332)
at Install.gotoWelcomePage(Install.java:573)
at Install.gotoPropertiesPage(Install.java:597)
at Install.gotoPropertiesPage(Install.java:589)
at Install.access$000(Install.java:55)
at Install$3.doAction(Install.java:219)
at Install.gotoInfoPage(Install.java:539)
at Install.installSystem4(Install.java:496)
at Install.main(Install.java:326)

What am I doing wrong?

September 22, 2016
3:16 pm
Karol Moran
Admin
Forum Posts: 42
Member Since:
October 28, 2014
Offline

If run as root do you get the same error message?

September 27, 2016
12:55 pm
RK
Member
Forum Posts: 7
Member Since:
September 20, 2016
Offline

Yes, when running as root, I get the same error message.

September 29, 2016
2:38 am
Ivy
Member
Forum Posts: 13
Member Since:
November 5, 2014
Offline

Maybe you can try it with expect script.

You may need install expect first.
$ sudo apt-get install -y expect

Then compose your expect script and run it with elevated privileges.

Here is an example.

#!/usr/bin/expect # script name: install_gs.exp spawn ./Install.sh expect "Select an option*" send "N " # put the screen prompts and your answers as many as you want # expect "blablabla" # send "" expect "Select an option*" send "7 " expect "Select an option*" send "3 " expect "Create Service*" send "true " expect "Select an option*" send "4 " expect "Create Database*" send "true " expect "Select an option*" send "I " expect "Do you really want to continue*" send "Y " expect "Press 'Enter' to continue*" send "Y " expect EOF

It seems the line end sign cannot show properly. Please add a line end sign (backslash + n) in each send text.
Hope this helps.

October 3, 2016
12:14 pm
RK
Member
Forum Posts: 7
Member Since:
September 20, 2016
Offline

Using expect did the trick. Thanks!

Forum Timezone: UTC 0

Most Users Ever Online: 69

Currently Online:
4 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

Alexandre De Sena Viegas: 18

Amit Dave: 14

Ivy: 13

Yves Savourel: 13

Emre Akkas: 12

Ayman Kh: 11

Anthony Kenny: 9

RK: 7

Li Jiayi: 4

biviel biviel: 4

Member Stats:

Guest Posters: 0

Members: 394

Moderators: 1

Admins: 3

Forum Stats:

Groups: 1

Forums: 4

Topics: 67

Posts: 207

Newest Members: Deborah Lu, Ilaria Chiarucci, OMOLOLA LAWAL, Andrei S, Patricia Gutierrez, Elian havelles, mamtadevi ji ji, john linkin, Gregor Rosulnik, Rudra Baba

Moderators: Karol Moran_1: 0

Administrators: waxingmedia: 3, Karol Moran: 42, gsteam: 0