?
Solved

Ruby - Rails - iSeries

Posted on 2014-11-12
3
Medium Priority
?
276 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 35

Accepted Solution

by:
Gary Patterson earned 2000 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 35

Expert Comment

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

Featured Post

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is a fine trick which I've found useful many times, when you just don't want to accidentally run a batch script or the commands needs administrator rights.
In this blog post, we’ll look at how using thread_statistics can cause high memory usage.
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

762 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