Solved

Ruby - Rails - iSeries

Posted on 2014-11-12
3
232 Views
Last Modified: 2014-11-12
Is anyone using Ruby on Rails on the iSeries? I am attempting to start this up from a command line, instead of within QSH.   From within QSH, I run the following:

CD /tmp/sfdc_rc_trunk_nojruby              
thin start -e development -p 9292

This starts up a session but holds onto that session so you are stuck in QSH. If you end it and get out - Ruby is ended.

I was attempting to start this from a command line - but haven't had any luck. I created a shell script that said the following:

#!/usr/bin/sh                              
CD /tmp/sfdc_rc_trunk_nojruby              
thin start -e development -p 9292  

I put that in the same directory as above - and tried to start it up using one of the following 2 commands:

SBMJOB CMD(CALL PGM(QP2SHELL) PARM('/tmp/sfdc_rc_trunk_nojruby/startruby')) JOB(POWER_RUBY) JOBQ(*LIBL/QRUBY) USER(QSYSOPR)

SBMJOB CMD(QSH CMD('/tmp/sfdc_rc_trunk_nojruby/thin start -e development -p 9292')) JOB(POWER_RUBY) JOBQ(*LIBL/QRUBY) USER(QSYSOPR)

Both jobs "complete" right away and don't stay running and Ruby is not "started".

I also made sure that the authority was set to excute, so that shouldn't be a problem.

Any assistance would be appreciated.
0
Comment
Question by:Matthew Roessner
  • 2
3 Comments
 
LVL 34

Accepted Solution

by:
Gary Patterson earned 500 total points
ID: 40437392
"thin start" starts a server - so what is happening when you start it interactively in QSH is correct and normal.  It really isn't something that you'd normally start interactively.

You can't run shell scripts reliably from QP2SHELL without doing some significant setup first, so I suggest you take that off the table for now.

So it looks like you can start the server from QSH interactively.  What happens when you start QSH interactively and enter the same command that you are submitting to batch?  Does it work without changing the directory first?

/tmp/sfdc_rc_trunk_nojruby/thin start -e development -p 9292

Assuming that doesn't work, next, test your startruby shell script interactively in QSH.  Does it work?  If so, then submit the shell script to batch using the QSH command, not QP2SHELL.

Unless your Ruby distro is specifically designed for QSH, you are probably better off running it in a PASE shell, so you may want to change your shebang line to to run in the PASE shell.  This means that even if you start from QSH, script gets executed in PASE - generally a good thing.

#!/QOpenSys/usr/bin/sh  

If you can get it to work from QSH interactive, then it should work OK from QSH batch, too.

- Gary

I
0
 
LVL 1

Author Closing Comment

by:Matthew Roessner
ID: 40437436
When I start QSH interactively (STRQSH) and enter the command I am submitting to batch:

/tmp/sfdc_rc_trunk_nojruby/startruby

Everything starts up fine (but I am "stuck" in QSH and if I exit - Ruby ends.

I did have to modify my startruby script to make sure was running from PASE:

#!/QOpenSys/usr/bin/sh            
cd /tmp/sfdc_rc_trunk_nojruby      
thin start -e development -p 9292  

Now when I start from a command line:

SBMJOB CMD(QSH CMD('/tmp/sfdc_rc_trunk_nojruby/startruby')) JOB(POWER_RUBY) JOBQ(*LIBL/QRUBY) USER(QSYSOPR)

Everything starts up correctly and all seems to be working as expected.  Looks like starting my script and running from the pase shell was the ticket.

Thanks for your help Gary!
0
 
LVL 34

Expert Comment

by:Gary Patterson
ID: 40437519
Happy to help.
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

HOW TO: Connect to the VMware vSphere Hypervisor 6.5 (ESXi 6.5) using the vSphere (HTML5 Web) Host Client 6.5, and perform a simple configuration task of adding a new VMFS 6 datastore.
Restoring deleted objects in Active Directory has been a standard feature in Active Directory for many years, yet some admins may not know what is available.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now